If its been longer on and/or then it could be anything from 0stiophites (bone spurs) to degenerative disc disease in the
neck and/or shoulder. but because you say the pains are not constant, it could be lungs, gas pains or just being muscular skeletal, the only way to know for sure is to go into see a doctor, additional questions and tests, I would start with a simple x-ray of the shoulder and cervical spine. this will also give a high level picture of gas, muscl strain etc...