I had an esophogeal ulcer about 10 years ago. The doc put a camera down my throat and took a pic. They jacked me up on demorol, so I didn't mind the procedure... HOWEVER...
In the interest of being thorough, my doc felt it necessary to check my other end too. So they gave me a Barium enema. Let me just say, never again... that procedure was completely miserable and painfull. Basically, they pump a cement truck up your ass with a fire hose and expect you to hold it in while they flip you around and take xrays of your insides. And no drugs to help you cope... it f'n hurt like hell.
After all that crap... they just gave me a scrip for Zantac, which is OTC anyway. I took the stuff every day for about 2 months and the ulcer healed. I would have rather tried the Zantac first. Now, whenever I get recurring indigestion, I just take Zantac for a week or two and I'm good for another six months or so. Sweets and refined sugar are what triggers most of my indigestion.
This isn't scientific, but I've been told that there is some type of "valve" or "flap" in your upper gi track that gets eroded by the acid in your system... heal the flap and the problem goes away. And Zantac inhibits the acid production, thus allowing the "flap" to heal. That could all be crap... but it kind of makes sense.