Heartburn occurs when acids from the stomach irritate the esophagus, the back of the throat. This condition may cause discomfort, reflux, or other symptoms like bad breath or cough. Symptoms may worsen in the evenings, after meals, or when a person is lying down, bending over, or exercising.