vubscs,
It is common for the toes to flex when the muscles of the foot cramp. This cramping can be very painful.
To relieve the pain and cramping, stretch the muscle by moving the toes in the opposite direction.
If the cramping is occuring frequently, you should be eveluated by your physician. Sometimes muscle cramps can be caused by electolyte imbalances, such as sodium or potassium.
Good luck.