I have found that when I start to cramp (rare but it happens) in either my calf or thigh I will stand on my pedals; not actually pedal or maybe only once or twice; but just stand up and flex....when I sit back down I feel the blood rush over and my muscles relax/stretch out a bit.
Just my .02