Hello,, it seems you have spasm of your neck muscles, not need to worry it can be treated easily with, giving rest to your neck by avoiding forceful movements at neck, using ice packs or using warm compression over neck will relieve pain faster,,, over the counter painkillers with muscle relaxants like tab. Dolowin-MR, will relieve your pain immediately. Avoid pillow for one or two days.
Most of the times these things will reduce your pain.
If pain doesn't reduce even after these then consult a orthopedician.