Ranitidine is used to treat ulcers of the stomach and intestines and prevent them from coming back after they have healed. This medication is also used to treat certain stomach and throat (esophagus) problems (such as erosive esophagitis, gastroesophageal reflux disease-GERD, Zollinger-Ellison syndrome). It works by decreasing the amount of acid your stomach makes. It relieves symptoms such as cough that doesn’t go away, stomach pain, heartburn, and difficulty swallowing. Ranitidine belongs to a class of drugs known as H2 blockers.