Hi
Welcome to the MedHelp forum!
If you have pain under your right rib then there could be a liver infection or a gall bladder problem. Get a liver function test, ultrasound or CT of abdomen, and pancreatic enzymes. It can also be due to acidity and duodenal ulcer. Take a late night snack. Raise head end of bed. Take Omeprazole empty stomach in morning and an antacid gel at bedtime. Refrain from smoking, alcohol, fuzzy drinks and spicy food. Walking around also helps clear gas. It could also be muscle pull that can be treated by applying local analgesic creams. It could also be costochondritis, which causes pain and tenderness at points where your ribs attach to your breastbone. The inflammation around the joint area gives sharp pain on taking a breath. This can also cause tenderness on pressing the area which pains. An orthopedic doctor can diagnose this for you. Generally there is no cause. However it can be due to infection, blow, injury, or fibromyalgia. It usually goes away on its own. Otherwise it can be treated with muscle relaxants, and non steroidal anti inflammatory drugs. It can also be muscle pull. Shingles can also start this way. Since a confirmed diagnosis cannot be given on net please discuss with your doctor once. Hope this helps. Take care!
have your doctor do a HIDA scan on you. Sounds like your gallbladder could be acting up. Or if you have had your gallbladder removed you could have stones stuck in a duct.