Prevacid treats erosive esophagitis by stopping the excess production of stomach acid in your body. With erosive esophagitis, a person's esophagus is inflamed and damaged by a backflow of stomach acid. With Prevacid, there is a reduction in the production of stomach acid. In cases of erosive esophagitis, Prevacid is typically prescribed for eight weeks. However, a person's response to the medication usually dictates whether another round is recommended.