Sprinkle the Salt
Cramping during a marathon is often the result of sodium depletion. Exercising more than 3 hours puts you at risk, not only for muscle cramping, but other serious problems too. Using table salt before any long runs can help with preventing leg cramps. Sport drinks or gel packs also contain a sodium mix. Carrying a salty snack, like pretzels, can help prevent cramping muscles.
Another key ingredient to preventing muscle cramping is potassium. Potassium is found in glycogen which is stored in your muscles. Potassium loading helps to prevent dipping in to your body's salt supply. Potassium rich foods can include various fruits, vegetables, dairy and fish.
Run the Long Runs
Nothing prepares your muscles for running a marathon than actually pounding the pavement or trails to accumulate your running miles. You should be running two to three long runs per month. A long build up of long runs helps your body become familiar with running more than 21 miles. Your last long run should be three weeks before the marathon. This gives your muscles adequate recovery time to perform at their peak on race day.
Drinking plenty of fluids is another prevention for muscle cramping. Water is recommended for runs that are less than 1 hour. Long runs require a sodium, carbohydrate mix found in sport drinks. A word of caution though--these highly concentrated sport drinks can cause stomach cramps, especially if consuming the drink for the first time. Take advantage of your long runs during training to experiment with different sport drink brands and flavors to know which work best for you. Diluting or chasing down the sport drink with a cup of water can help aid in preventing stomach cramps.
At a minimum you should be consuming liquid every 25 to 30 minutes, more in higher temperatures.
One of the great benefits of being a runner is the justification for a massage. Whether professional or from a willing loved one, massaging tired achy muscles is an ounce of prevention for leg cramps. Massage helps keep muscles in top shape and conditioned for your long runs.