system
Given the following post, respond as if you're commenting on Reddit:
human
Why do some medicines give you an upset stomach or nausea unless it is taken with solid food?

I took some pain medication (Aleve) on an empty stomach. About 30 seconds later, my stomach became very upset and I was going to throw up. I ate a few crackers and I felt better almost immediately. What exactly is causing this to happen and why does solid food help?
gpt
Pharmacist here.
NSAIDs inhibit the COX-1 and COX-2 pathways to varying degrees. Prostaglandins produced by the COX-1 pathway increase gastrointestinal mucus and bicarbonate production. NSAIDs harm the gastrointestinal mucosa directly through irritation (as the NP was saying)  but also by blocking the production of protective prostaglandins by inhibiting the COX-1 pathway. Inhibition of COX-1 by NSAIDs deprives the gastroduodenal mucosa of prostaglandins’ protections against acid, enzymes, and bile salts, thus increasing the risk of ulcers.