TMJ stands for Temporo Mandibular Joint. This is the joint in front of the ear hole, that connects the mandible (lower jaw) to the temporal bone of the cranium. The temporal bone houses the hearing and balance apparatus as well.
Pain at the TM joints is usually due to an inflammation of the ligaments that hold the two bones, the temporal and mandibular bones, together and form a capsule around the joint. This Capsulitis is due to strain in the joint from very hard clenching or grinding during deep sleep. The underlying cause of this is the disharmony of the bite - a malocclusion.
The other causes of pain in TM joints are due to internal derangement; a torn ligament that acts as a connector for the articular disc between the two bones. The disc is meant to act as a bearing between the articular surfaces of the bones when they function. When the disc is dislocated, at some point during opening of the jaw the disc will pop into place causing the clicking noise.
When this dislocation is uncorrected, it could lead to destruction of the joint surfaces and result in arthritis of the joint. This would also be a source of TMJ pain.
Healthy TM joint. Quiet joints smooth movements.
Dislocated disc causing popping/clicking noise.
Damaged joint causing grinding noise.