If you need to take one of these medications for more than 10 consecutive days, see a gastroenterologist, Dr. Cryer said. Also, Dr. Bhattacharya added, see a doctor if you get heartburn more than a few days a week.
Heartburn accompanied by difficulty swallowing or unintended weight loss especially warrants a trip to the doctor, she said. That could signal a more serious condition like gastroesophageal reflux disease, or GERD, which is a chronic, more severe form of acid reflux, or esophagitis, an inflammation of the esophagus lining, which may require different treatment.
For severe heartburn, doctors can prescribe stronger doses of P.P.I.s or H2 blockers, Dr. Cryer said.
If over-the-counter or prescription heartburn medications don’t work, certain surgeries are an option, Dr. Reed said. One, called fundoplication, involves wrapping the top part of the stomach around the lower part of the esophagus to strengthen the barrier between them.
To prevent heartburn before it starts, avoid foods and beverages that you know may set it off, Dr. Reed said. It’s also helpful to elevate your head while sleeping and to refrain from lying down immediately after eating. If you smoke or drink, cut back on both; and if you’re overweight, losing weight also can potentially prevent heartburn, Dr. Reed said.
What’s unlikely to work are herbal remedies like chamomile tea, ginger or licorice extract, Dr. Cryer said — scientists don’t have strong evidence that they help with heartburn. And those remedies shouldn’t replace proven therapies like medications, he said.