If you have one, a recent study has come out showing that direct strengthening of the neck muscles significantly relieves neck pain - more so than general fitness training.
We at Serious Strength have know this for decades and have helped scores of people relieve not only their neck pain but their lower back pain as well.
Machines like this one called '4 way neck' directly strengthen the muscles of the neck in flexion, extension (shown below) and lateral flexion are a godsend to many.
Here's the low back exercise to give you a visual (this is an older model - we now use an even better version):
So if you have spine pain, get thee to a gym that has these devices, do them Slow Burn style for safety and better overall benefit. As little as 1 session a week will do the trick!