Neck pain can be multi-factorial. Most of the time neck pain is due to a lack of exercise. If neck and back muscles are too weak, this causes poor posture and stiffness, which can lead to pain. Degenerative changes will also gradually effect the small joints of the vertebrae and discs (possibly resulting in a disc protrusion). Finally, an inflammatory response may result in additional pain.
Most of the time conservative management (physical therapy and anti-inflammatories) is sufficient. If not, then there are various special injections. Please read more (link).
However if neck pain is radiating into the upper extremities accompanied by numbness, then further investigation is warranted.