Hi
Welcome to the MedHelp forum!
Neck pain can be due to wrong posture, spinal nerve compression, arthritis of spine joints, and in your case also due to the swollen lymph nodes. The other possibility is that the lumps are neurofibromas (collection of nerve and fibers) that can be painful. Removal of these lumps can relieve pain.
Since I cannot examine you and know other related conditions you may be having, nor is a detailed history possible on net, I have listed the various possibilities that should be looked into. Please consult your PCP for primary examination followed by proper referral.
Take care!
I occassionally had similar symptoms along with a sharp pain sometimes going to the side of my head. I ended up having a root canal and the symptoms went away. Hope you feel better!