Heartburn is a burning sensation felt in the esophagus and chest due to indigestion and reflux of stomach acids. Women often experience mild to moderate heartburn  during the early stages of pregnancy. It is quite common during the second and third trimesters as well.
Causes during early pregnancy: The high levels of the hormone progesterone relax the valve between the esophagus and stomach. As a result, it is unable to close properly to prevent stomach acids from entering the esophagus and irritating the lining, causing heartburn 
Causes during later stages: The growing uterus is the main reason for the symptom, especially after the 20th week. It pushes the stomach against the diaphragm, causing the stomach contents to move into the esophagus. This leads to acid reflux and heartburn .
Non-prescription antacids like TUMS can be safely used for getting rid of heartburn in pregnancy while they also provide certain nutrients (e.g. calcium) essential during pregnancy . Physicians strongly recommend avoiding antacids containing aluminum while sodium bicarbonate (or baking soda) and sodium citrate sold as antacid tablets should be avoided as well .
Apart from calcium containing antacids, a few other safe medications are:
One should consult her doctor before using any of the above medicines; otherwise, they may lead to various pregnancy-related problems. The following side effects  may occur in some rare cases:
Here are some other ways to stop heartburn:
It is advisable to call the doctor in case of the following symptoms along with heartburn:
One myth says that if a woman suffers from heartburn during pregnancy, she is going to have a baby with a full head of hair . There is another myth saying one can find out if she is going to have a boy or girl depending on whether or not she has heartburn while pregnant. But in truth, these are just old wives tales as each pregnancy is different with different signs and symptoms.
Its ICD-9 code is 787.1 while the ICD-10 code used for heartburn is R12.