TMJ is when your bones in your jaw joint don't glide properly, basically. It somehw involves cartiledge in your jaw, and bones rubbing together. TMJ was my first thought after reading your OP, but I think you should seek a second opinion.
Neproxin (Aleve) works wonderfully helping intense TMJ flare ups (assuming that's what's wrong with you).
Most of the time those awful episodes like you're describing will eventually just go away on their own, but neproxin works really fast...like within 4 or 8 hours.
The most important thing with TMJ is to NOT try and "stretch it out", no matter how tempting it is....just let your jaw rest...if you're opening or closing your mouth and it starts to hurt, then stop. It'll only make it worse.
Drink soup in the mean time. With a straw if you have to.
BTDT. It sucks.
As an irritating side note, the first time I went to a doc for this, he winked at me and said "You know, it's usually young, otherwise healthy women who come in with this."
I didn't "get" his insinuation till I was driving home.