Eat bananas! drinking the odd sports drink (powerade etc) will help too. When they happen, gently stretch the leg etc until you feel it beginning to ease off a little and then I find giving the area a bit of a rub afterwards helps too.