A muscle spasm or a muscle cramp is an involuntary contraction of a muscle. These cramps can occur suddenly, without warning and they can cause sharp pain. In some cases, you might even be able to see a hard lump of muscle beneath the skin. Muscle spasms usually resolve after some time on their own. These spasms can last from a few seconds to a few minutes.