its because of cervical spondylosis. the neck muscle pain and the shoulder.Muscle pain is due to muscle spasm and muscle weakness which occurs over time. You need to go to a physiotherapist as this the only and the best option for this problem.
Next Steps
You should consult a physiotherapist and get it assessed first and then treated(SWD+Ultrasonic therapy+IFT+Certain stretching & strengthening Exercises)
Health Tips
For neck-at home.rest +hot water fomentation+application of pain killer gel..avoid forward neck bending, weight lifting, cold exposure ,long travelling or driving, no prolonged sitting,no long table work.