When you start to notice an ulcer's symptoms, consult a doctor before taking any medications on your own. A doctor may be able to assess the condition properly and prescribe the best medication for your ulcer.