I can't remember the exact chemical reaction going on in your stomach but it eats away at your stomach lining and can cause ulcers, same with Ibuprofen. Tylnol is the easiest on the stomach but its hard on your liver so never take it after a night of drinking. They all have their ups and downs.
Aspirin thins your blood, but I'm not sure after that what directly causes the heartburn. Taking too much aspirin is never a good thing. What kind of pain are you having? There are alternative ways to calm and relieve pain/pressure. Gertie, do you have that gastroesophagal disorder? Because I know that the drug company that makes a medicine for that has a mascot stuffed animal called GERTIE. We have one, and my cat plays with it.. hehe