Thanks for your query.
1. The sound on movement of head associated with pain may be due to cervical spine
pathology. The outgrowth of small bones from vertaebrae is mainly responsible for these sounds. This needs consultation by an orthopaedician on priority.
2. Neck exercise on regular basis after consulting your doctor will reduce both the pain and the sounds.