You are being treated for heartburn or hiatal hernia, and you feel sudden chest or stomach pain, have difficulty swallowing, are vomiting, or are unable to have a bowel movement or pass gas; you may have a hernia that has become obstructed or strangulated, which are emergencies.
One strong possibility for your symptom is gall bladder stones and cholesterol deposits within the gall bladder which can cause sharp pain. Getting an ultrasound of the upper abdomen done in a walk in clinic or the ER will confirm the diagnosis.
1 Gallbladder disease-This too may cause pain in upper right abdomen, which may be experienced as pain under right rib cage. 2  Gallbladder disease occurs due to inflammation of the gallbladder, most often, due to gallstones. 3  Gallstones form when fluid stored in the gallbladder hardens. Ulcers-Pain in the lower regions of the rib cage may also be due to an ulcer. 2  An ulcer is an inflamed wound in the upper GI tract. 3  Ulcers occur when inflammations cause wounds and sores in the stomach lining. 4  The H. pylori bacteria and Nonsteroidal anti-inflammatory drugs (NSAIDs) are common causes for ulcers.