Keep getting muscle spasms at the sides and bottom of my rib cage mostly happens on the right side. What can cause this? Thankyou!

Several possibilitie. I am sorry to hear of your pain. The differential diagnosis includes scoliosis with muscle spasm along the convexity of the curve, thoracic nerve root injury, or retroperitoneal problems such as kidney stones. I am sure there are others so please see your primary care doctor and discuss the possibilities. Good luck and take care.