Famotidine is used to treat ulcers, gastroesophageal reflux disease and conditions where the stomach produces too much acid, such as Zollinger-Ellison syndrome. It is also used to prevent and treat heartburn due to acid indigestion and sour stomach caused by eating or drinking certain foods or drinks. Famotidine is in a class of medications called H2 blockers. It works by decreasing the amount of acid made in the stomach. Always read the leaflet before the use of medication.