Usually cramps occur on several reasons:
1. dehydration
2. lack of electrolytes (salt, magnesium)
3. muscles are not used to that kind of effort. In case of foot this overstrain might be caused by a wrong kind of shoes..
I'd try first drinking isotonic sports drink 1/2 hr before the run and during the run. If the problem persists I would go to footscan to find out what kind on shoes are appropriate to my foot type.
Good luck!