A muscle spasm is a sudden contraction of a muscle that causes a sharp cramp. They usually occur unexpectedly, very quickly, are painful, yet resolve as fast as they came. Spasms to the muscles of the skeletal system are the most common and occur when they are overused and tired. This is common in the neck, shoulder, and back. Conditions of the spine (such as a degenerative condition or a spinal cord injury) can be associated with muscle spasm.