Dehydration, overuse of a specific muscle, and intensive exercise can result in muscle spasms in the legs. Other areas commonly affected include the neck and the back.