There are several causes of pain in the last rib on the right: the first is the early stages of shingles, which can also occur in the early stages of herpes zoster with pain in the chest, lower back, and back, and clusters of herpes appear after the incubation period has passed. The second is rib tumors or metastatic tumors of the ribs, which can also present with pain in the ribs, and often require CT as well as X-rays to rule out the presence of lesions in the ribs. The third is costochondritis, when costochondritis occurs in the ribs, pain on one side of the ribs can also occur. The fourth is intercostal neuralgia, intercostal neuralgia is often caused by chronic inflammation of the intercostal nerves that run along the ribs, which can also show up as pain in the ribs, and these are the common causes of pain in the last rib on the right side.