Thanks for the added information.
This could be a pinched nerve, or a pulled or strained muscle. I'd be more inclined to think it is a muscle spasm resulting from a strain. Sounds like a nerve is being upset from time to time.
It certainly merits bringing up to the doctor the next time you are there. Sooner if the pain is worsening, or stopping you from activity.