Gas in the stomach can be painful as it is trapped. To get rid of it may be as simple as taking an antacid. If it continues, consider changing your diet as an often overlooked area that causes stomach (and intestinal) upset is gluten, which is mostly wheat-derived. Many foods contain gluten, but the number of gluten-free products on the market today is sizable and increasing. Failing any relief it is advisable to consult a doctor.