It is due to acid reflux, in which stomach acid leaks into the esophagus. Common causes of heartburn include incomplete closing of the valve between the esophagus and the stomach, eating fried and spicy food, anxiety, insomnia, obesity, wearing tight clothes, excessive smoking, drinking alcohol, and stress.
Here are few tips:
- Keep a note for few weeks during an attack to find out any possible contributory factors and avoid those things.
- Take 1/2 cup aloe vera juice three times a day. It helps to soothe an irritated esophagus.
- Eat a bowl of rice pudding made with milk which helps to absorb stomach acid.
- If you are overweight, try to lose weight.
For more details see below link: