Your description is not clear - is it on the right side under the ribs? or 'right under' the rib?...
Most pains abdomen start in the middle line and shift subsequently
Under the rib cage
and right side . going back to shoulder or shoulder blade - may be gall bladder
If it is in the pit of stomach - 'rib cage comes together' and going up, it can be from heart also. Unless the pain is very severe, there should not be light headedness or dizziness
There is no mention of your age or gender
You should SEE A DOCTOR AS SOON AS POSSIBLE. You need an ECG to check the heart. You need blood tests - for heart, stomach, liver
and so on. Delay could be dangerous.