As I have said before when this subject has come up, it is very unlikely that what you have is actually Ulcers, per se.
What Charlotte had in her mare- THAT sounds like ulcers.
What other people are describing is the scenario that would lead up to ulcers forming if not treated.
Ranitidine and Cimetidine are the drugs of choice for these situations and neither will harm a pregnant animal or human- I have been on Ranitidine since it was first on the market and I have not grown an extra leg yet!!
BUT neither of these drugs has actually been tested on animals and are not approved for animal use by the FDA- thus there has been no actual dosage worked out by clinical trials.
I use Ranitidine as a first line of defence because I have it to hand- I really do believe Gastroguard (Omeprazole) is better.
You do need to talk to your vet at the very least- if yours is out of town phone another and get advice as to the dosage.
Ranitidine/Cimetidine are very tolerant drugs and it is hard to overdose but you do need to be sure that you are actually treating the problem correctly.