You may have tonsil stones in your tonsils. Because they are hard, they can hurt when you yawn. The tissues in your pharynx become stretched during yawning, and the tonsil stones then press more the tissues around them.
Hi,
Throat infections can be caused by bacteria like streptococcus or it could be a viral infection. Bacterial infections need antibiotics. Try warm saline gargles. That may provide some relief. The other possibility based on your symptoms could be due to a post nasal drip, which can cause a chronic irritation in the throat. This could be due to a sinus infection, a cold or a chronic allergy. Voice rest is usually advised. Please discuss this with your doctor I am sure he will provide further assistance. Regards.