Generic Pepcid is used for treating and preventing ulcers; treating and preventing heartburn associated with acid indigestion and sour stomach. It is also used to treat gastroesophageal reflux disease (GERD), conditions that cause increased acid secretion and esophagitis.