Neck pain can come from trigger points or knots in the neck muscles. Basically, a trigger point is when muscle tightens up in a particular spot. Stretches & exercises can help relieve & reduce the muscle knots.
The first two stretches are my favorites for any kind of neck pain. An upper trap stretch and a levator scap stretch can help relieve neck pain and release the trigger points.
The neck stretch is for the scalene muscles. This one can be done a few different ways.
Exercises can help relax the muscles as well. A chin tuck is not only great to stretch the muscles, but it also helps strengthen them as well.
Finally, if stretching is too uncomfortable or maybe contraindicated, a ball can be used to press directly on the trigger point to help release it.