Hi, Thanks for query,
You have not mentioned your age.
If you are elderly then it might be due to cervical spondilitis.
Due to osteo artheritis changes and osteiophytes formation you might be having cracking noise and neck pain
while raising your head.
Go for x ray
cervical region and find out the cause.
Ok and bye.