You really require an in-person evaluation by a physician.
That being said the symptoms suggest gall bladder problems.
Your liver is located there. Do you have any other symptoms besides the tenderness and pain? You can try a liver detox or see your doctor since it seems to be happening more frequently. Are you a frequent drinker? Sharing razors and toothbrushes I just learned can cause hepatis if the person you are sharing with is infected. Are you experiencing jaundice (yellow color) of the skin or sclera (white of eye)?
Keep a journal of ANYTHING happening around the time of these attacks and bring that with you to the doctor. Im just a nursing student but the longer you let a liver problem go the worse it will be!
Could be costochondritis, or an injury to an intercostal injury, which are common conditions that can last a while if you're continually straining your muscles/ribs with coughing, sneezing. They're characterized by the pain you describe, as well as being worse if you press on the area where it hurts. It could also be post-herpetic neuralgia, which is a condition people can get after getting shingles in that area.
Your doctor should be able to help figure out what it is. If it's any of the conditions above, the prognosis is good.
I've been thinking / wondering gall bladder also. However, I really do not notice it to be worse after I eat. I do find it worse in the evenings and after exercising (especially after weights or sit-ups). Also, I'm not vomiting or running a fever. I've seen the Doctor about it, but immediately he started treating me for costochondritis. I took NSAIDS for about three weeks which did not help. I had a chest x-ray which didn't show anything wrong with my ribs or cartlidge. I have another doctor's appointment next week. I guess they will check my gall bladder next.
Welcome to the MedHelp forum!
If the pain is on the outside, it can 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.
If you have pain under your right rib then there could be a liver infection, pancreatitis, 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. Pain under right ribs with gas can be due to any inflammatory bowel disease like Celiac or Crohn’s, IBS or due to food intolerance. Pain under right rib case can also be due to pleurisy, asthma, or any other lung problems. Usually this is accompanied by lung related symptoms like breathlessness, cough etc.
Since I cannot examine you and know other related conditions you may be having, nor is a detailed history possible on net, I have listed the various possibilities that should be looked into. Please consult your PCP for primary examination followed by proper referral. Take care!