I'm concerned that you're referring to painkillers. If you're taking any NSAID's, such as aspirin, neurophin, declafenic, voltoral, etc, you could be exascerbating the problem. You may have an ulcer which can easily be addressed. If this is continual your GP may prescribe ranetidine or omeprazole. But for now, stay off the NSAIDS, coffee, spicy foods, caffeine and get yourself a bottle of Gaviscom. But most importantly, see your GP! That's the most valid advice for situations such as these.
I wish you better health
Fr Bill