Long-term usage of pharmaceuticals known as non-steroidal anti-inflammatory drugs, or NSAIDs, can also result in ulcers. Many of them are sold without a prescription. Examples include ibuprofen, naproxen, and aspirin (Excedrin, Aleve) (Motrin). These medications hinder the stomach's capacity to defend itself against acid and can result in an ulcer. Additionally, some NSAIDs are prescribed to treat illnesses like osteoarthritis, rheumatoid arthritis, and persistent back pain. It's crucial to talk to your doctor about potential side effects and measures to prevent ulcers if you must take one of these medications.