Yes, supportive footwear and plenty fluids. Try some regular foot stretches.
I have found that short daily massages help as well. Pay close attention to evenly distributing your weight through out your feet.
This will sound weird buuuuuut a friend of mine uses her pedicure toe separators to help her spasms. Puts them on for a bit every night.
Make sure that you wear good supportive footwear and take care when using the treadmill.
If your feet are hurting on the bottom and not the top, it may be plantar Fasciitis. It's very painful and is mostly on the heels and balls of your feet. I hope this is not what you're experiencing, it's not curable, doctor recommended really stiff insoles but, they just made them hurt more. Good luck and way to go, keep improving your health!
As well as following the advice given by Caryopteris, make sure that you drink plenty of water so that you do not become dehydrated.
Before doing your workout make sure that you do warm up and stretching exercises. The gym instructors should advise you on this.
Take magnesium and potassium in the morning and calcium and vitamin D at night.