Neck pain is a top reason for doctor visits and is more common in women than men. It's is often a response to overexertion, poor posture, stress, an injury, or sleeping in the wrong position. It can also arise from an injury where the neck experiences a rapid, forceful back-and-forth movement (whiplash), or from arthritis. Shoulder pain without neck pain tends to stem from an injury, for example, from strains or tendinitis.

Treat It First With

Exercises that strengthen and stretch the muscles of your neck have been shown in studies to work better than medication for relieving neck and shoulder pain. Apply heat for 10 to 15 minutes periodically for the first day or so after an injury. Support your neck while you sleep by lying on your back with one or more pillows beneath your knees and a small pillow under your head; doing so keeps your neck and head in a neutral position. If you need further relief, our Best Buy Drugs analysis suggests trying over-the-counter painkillers such as ibuprofen (Advil and generic) or naproxen (Aleve and generic).

If That Doesn’t Work

Physical therapy with exercise can help with persistent neck and shoulder pain; studies show relief can happen in as few as one to three sessions. Work with a physical therapist on your posture—for example, how to improve the position of your head and neck when you talk on the phone or work on a computer. Working with a cognitive-behavioral therapist can teach you relaxation and stress-reduction techniques to lower stress-induced pain.

Get to an Emergency Room

If your pain stems from a recent fall or car crash, that could signal a serious problem, such as a dislocated shoulder. Pain that comes suddenly, running to your jaw, one or both arms, or neck, along with shortness of breath, dizziness, or sweating could be signs of a heart attack.

Never Do This

Avoid cervical traction, in which a physical therapist pulls your neck. Research hasn’t shown it to be helpful. Also skip injections; repeated steroid shots can weaken neck muscles, and Botox injections don’t work better than placebo injections. Surgery usually won’t help if the pain is only in your neck or is caused by arthritis.

Prevent It in the First Place

Regular stretching can help prevent muscle spasms that trigger neck pain. Or try acupuncture. A November 2015 study in the Annals of Internal Medicine found that it substantially eased neck pain for people with chronic symptoms. In our 2011 survey of alternative therapies, 44 percent of people with neck pain said acupuncture “helped a lot.” Consider trying a new pillow based on how you like to sleep. Side or back sleepers need small pillows that keep the neck in a neutral position. Avoid sleeping on your stomach. For back sleepers, avoid pillows that pitch your neck too far forward.

Editor's Note: This article and related materials are made possible by a grant from the state Attorney General Consumer and Prescriber Education Grant Program, which is funded by the multistate settlement of consumer-fraud claims regarding the marketing of the prescription drug Neurontin (gabapentin).

This article also appeared in the June 2016 issue of Consumer Reports magazine.