Anxiety can result in muscle spasms by causing tension in the muscle, resulting in cramping and pain. Such cramps are treated by managing stress and ensuring a healthy lifestyle.