A spasm is an involuntary contraction of a muscle. A cramp is a strong, painful spasm that is usually short lived. There can be clonic spasms characterized by alternating cycles of contraction and relaxation and tonic spasms, which are sustained periods of tonicity. Spasms and cramps can be caused by nutritional deficiencies (especially low calcium and magnesium), ischemia (deprivation of oxygen caused by impeded blood flow), inadequate warm-up before exercise and protective splinting.
As long as the spasm or cramp is not related to a contraindicated condition, massage can be safely administered, though caution does need to be taken to avoid damaging muscle tissue. The one main contraindication would be when muscles are splinting, which is a protective mechanism the body uses to prevent further injury.