Esomeprazole (es oh ME pray zol) prevents the production of acid in the stomach. It is used to treat gastroesophageal reflux disease (GERD), ulcers, certain bacteria in the stomach, and inflammation of the esophagus. It can also be used to prevent ulcers in patients taking medicines called NSAIDs. You can also buy this medicine without a prescription to treat the symptoms of heartburn. The non-prescription product is not for long-term use, unless otherwise directed by your doctor.