Famotidine is a medication that belongs to a class of drugs known as H2 (histamine-2) blockers. It works by reducing the amount of acid produced by the cells in the lining of the stomach. Famotidine is commonly used to treat and prevent ulcers in the stomach and intestines, as well as conditions such as gastroesophageal reflux disease (GERD) and Zollinger-Ellison syndrome.