The most inexpensive first-line medicine for pain related to muscle spasm, such as headache or neck pain, is an over-the-counter pain reliever, such as a non-steroidal anti-inflammatory drug or acetaminophen, according to Healthline. These medicines are often as effective and typically less expensive than those designed for spasms.
Adding a regimen of ice packs alternating with heat to the affected area also helps reduce muscle soreness, explains WebMD. If pain is not relieved by these measures, the most inexpensive medicine designed specifically for muscle pain is generic cyclobenzaprine, Healthline states. Also sold under the brand name Flexeril, this medicine is available only with a doctor's prescription. Side effects include dizziness, sleepiness, dry mouth and constipation, as MedicineNet explains.