Can gas cause severe pain under right rib cage?

It can. However, the more concerning thing to consider is gallbladder or liver issues. If you are having pain that comes and goes, it may be gas, constipation, or gallbladder stones or early cholecystitis. You'd benefit from having it checked asap as it could lead to more concerning conditions if it is your gallbladder. Any systemic symptoms, fever, chills, abdomen rigid, increased pain, go to er.