Margy is right, it could very well be GERD or acid reflux, it really can hurt, so can a bad case of gas, in fact, I get gas so badly that it will even cause irregular heart beats at times.
If it gets worse, it would be wise to get it checked out, chest pains are nothing to fool around with.
Could be GERD thats reflux can be painful ,meds may help you, where is the pain if its on the right under the ribs radiating to your back, could be some gall bladder distress, always get chest pains checked out, is it worse when you eat, what triggers an attack ?