If you're one of the millions of Americans who gets heartburn, there's a lot you can do to put out the fire. One thing you don't want to do is ignore it. Heartburn occurs when stomach acids flow back up into your esophagus. That's the pipe that carries food and drink from your mouth to your stomach. Over time, frequent heartburn can cause serious damage to your esophagus. To prevent that, start with some lifestyle changes. Change your diet, lose weight, cut back on caffeine, don't smoke, and don't eat close to bedtime. If these steps don’t help, you have several options for over-the-counter (OTC) and prescription treatments. Antacids Antacids are OTC medicines. They're usually the first line of defense against heartburn. Antacids change your stomach juices so they're less acidic. Less acid means less heartburn. Antacids are inexpensive, safe, and work well for mild heartburn. Tablets are the most convenient, but liquids work better because they help to coat the lining of the stomach. Common ingredients in OTC antacids include magnesium hydroxide, aluminum hydroxide, and sodium bicarbonate. The usual directions are to take an antacid after meals and before bed. You might experience diarrhea and constipation as side effects of taking antacids long-term. Antacids are really for short-term relief. If you need to use them for more than two weeks, ask your doctor about better options. H2 Blockers H2 blockers stop the production of acid in your stomach. They work better than antacids. They also can help heal damage to your esophagus. They come as OTC medicines or by prescription. Heartburn relief typically occurs within an hour. OTC brands are fairly inexpensive and are effective for treating heartburn. Dosing is different between brands so be sure to follow the directions on the package. Diarrhea, rash, headache and dizziness are possible side effects. Proton Pump Inhibitors (PPIs) PPIs are the next step up from H2 blockers. They block molecules that cause the stomach to produce acids. You can take these drugs on a long-term basis to treat heartburn. They work better than H2 blockers at stopping acid production and healing the esophagus. PPIs take at least 24 hours to provide symptom relief. PPIs are available by prescription, and some are OTC, too. Be sure to take PPIs as directed, on an empty stomach. Beware that taking high doses of PPIs for a long time could increase your risk for bone fractures. Key Takeaways After lifestyle changes, medications are the first line of defense against frequent heartburn. OTC antacids are effective for mild heartburn. H2 blockers are more effective than antacids and can help heal your esophagus. PPIs are the most effective drugs when you have long-term heartburn.