In reply to woolsack:
I had a thread going a little while ago on here about essentially the same thing but, annoyingly, a different muscle (top of the calf). Much debate ensued, but the answer seems to have been to drop my saddle a bit.
The electrolyte argument doesn't convince me - largely because the extend of the problem would presumably vary with temperature and degree of sweatiness rather than effort/duration. Curiously though, and although I still get it a bit, it only happens when I'm on my own and working hard to keep an average pace up - if I can get a break now and then by drafting behind someone then there's no problem at all. Tends to kick in when I go over the top of a climb.
A friend thinks certain gels bring on cramp with him - however that may be, getting all wobbly and falling off is worse for me, so I'll stick with gels!