pain in the upper right abdominal area can be caused by several problems. liver,appendix, r.kidney, blocked colon. see your physician asap to get checked.
things that can ccause pain on the right side near your ribs there could be something wrong with your stomach or you could have bruised ribs or it could even have something to do with your breathig you may not have enought oxygen thinks like asthma can cause this also.
It can be anything from gas to a vertebral fracture. Try moving side to side and see if that helps. If the pain persists, or is bothersome, see your doctor.
This could be the gall bladder and if it's intense or you're feeling nauseous you should seek medical attention. There's a chance it could be pleurisy.