Pain in right back ribcage when I cough?

Depends on. level of pain and associated symptoms, but it could be rib fracture or pneumothorax. It could also be something unrelated, such as zoster. Consult with your doctor to be sure.