Stomach ulcers are sores in the lining of the stomach, according to MedlinePlus. These sores occur when the acid that normally aids in digestion of the food attacks the tissue. The most common cause is a bacterial infection involving Helicobacter pylori, but long-term use of nonprescription or prescription pain medication can result in a stomach ulcer.
H. pylori live in the mucus lining of the stomach and often don't cause a problem, according to Mayo Clinic. As of 2014, it's not clear how the bacteria infect an individual, but potential routes include kissing, eating contaminated food and drinking infected water. In some people, the bacteria cause inflammation that leads to an ulcer.
Some pain medications also lead to the irritation that allows stomach acid to cause an ulcer. Medication-induced ulcers are more common in older individuals who use the drugs regularly for arthritis or other types of pain. Bisphosphonates, medications for the treatment of osteoporosis, also have the potential to cause ulcers.
Once a stomach ulcer develops, it requires proper treatment to heal, according to MedlinePlus. Milk or antacids help to reduce pain but cannot heal ulcers. If H. pylori infect the stomach, treatment requires a prescription antibiotic. If ulcers do not heal when taking the antibiotic, the patient often requires surgery.