Hello,
Muscle spasms can be due to alterations in the balance of salts in the bloodstream (such as a high or low calcium, sodium or potassium level),neuropathy(esp in diabetes),hypothyroidism, nerve compression, and multiple sclerosis,spinal cord injury,cerebral palsy or stroke.
My advise is to consult a physician and rule out the above medical conditions by thorough investigations as without physical examination and investigations, pinpointing a diagnosis is tough.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
I have had the same symptoms since I injured myself at home trying to open a jammed door with my shoulder. I had incredible pain on side of my ribs and actually felt like ribs shifted.I have had X-rays and nothing can be seen on them. Since then I have been experiencing the charly horse type pain when stretching, dressing and sleeping. It effects my toes, legs, chest and back.