Stomach spasms caused by conditions such as gas, dehydration, and muscle strain can usually be treated at home. Other conditions or severe stomach spasms usually require treatment from a doctor. Your doctor will try to determine the underlying cause of your stomach spasms and treat that cause.