Each person's neck pain is different and each person responds to pain differently, so review with your doctor which may work best for you.
The medications that may help include:
over-the-counter medication for pain such as acetaminophen, or a non-steroidal anti-inflammatory drug (NSAID) such as ibuprofen or naproxen
an ointment or cream applied to the painful area, such as Icy-hot or BenGay
prescription medicines such as muscle relaxants (diazepam, cyclobenzaprine, or methocarbamol) and higher doses of ibuprofen and naproxen
powerful pain relievers, such as narcotics (codeine, propoxyphene, oxycodone and others); side effects, such as sedation, constipation and nausea, are common and limit the use of these; they are also habit forming, so low doses and short duration of use are recommended if these medications are prescribed
tramadol (Ultram), a non-narcotic medication that acts in a similar way to narcotic medicines
injections of cortisone and long-acting anesthetic agents; these are occasionally offered for certain causes of neck pain (such as osteoarthritis, disk disease or spinal stenosis).