Pain medication usually can't heal back pain, but they can mask the effects enough that other treatment can have a chance to work. The first class of drugs you can try are the over the counter medications you can buy at the pharmacy without a prescription, like Tylenol or ibuprofun.
If you need stronger medication you'll need talk to your doctor about getting a prescription for a narcotic, like codeine, or muscle relaxant, like Valium. Caution is needed though when taking prescription medications as side effects can be more severe.