There is a possibility of stiffness in neck muscles which may be positional while working or due to abnormal posture at night..
It may be associated with stretching of nerves going towards shoulder thus causing pain..
The clicking sounds may be sometimes associated with tightness around the joints. If it is occasional, then it's ok..
If it is causing pain it needs to be checked..
Next Steps
I would suggest you to start with hot fomentation, analgesic with muscle relaxant tablet, local analgesic ointment,
calcium and
vitamin d supplement.. If the problem is not resolved, we can plan for getting x ray done..
Health Tips
Avoid heavy work. If you are working over laptop, take frequent hourly breaks for atleast 5 min. for neck stretching. Also, you may start joint movement exercises .