Do talk to your doctor now to be sure that it's nothing more serious, but the kind of pain your describe and its location could actually be a muscle tension headache. What you are feeling may be a muscle spasm and its aftermath. I say this because of its location and the fact that it is tender to the touch afterward (just like a sore muscle after muscle spasms elsewhere).
Your doctor will be able to eliminate other, more dangerous possibilities (such as a vascular issue), and give you coping strategies (heat/cold application, meds, massage, etc.) if it is a tension headache.
Have you noticed whether or not these have a trigger? Based on what you've said here, it sounds like strong sensations in your mouth that cause muscles to contract might be it.