I'm not planning on running a marathon in a long time, but a recent paper - Metabolic Factors Limiting Performance in Marathon Runners by Benjamin Rapoport - may prove quite useful to those who do or when I do finally get around to running another marathon.
In short, Rapoport has devised a series of calculations that can be used to help you optimize your carbohydrate consumption and race pace to achieve a maximal-for-you performance over the full marathon distance. A brief explanation can be found in this Runner's World article. Now the calculations involved are pretty complex, but thankfully you don't need to be a mathematician to take advantage of them. Simply plug in your details into his easy to use calculator (requires Java) and then get eating and running.
With a bit of carbo-loading at my current age and fitness level (though I think this has been a bit over-simplified as it only relies on my current resting heart rate), apparently I should be able to do a sub-3 hour marathon without hitting the wall:
Now whilst this is all well and good, it does concentrate on the use of carbohydrates as the primary fuel source, which is understandable. I wonder how the results of this study would be affected by someone who's trained their body to primarily burn fat for fuel, like those on ketogenic diets or even someone on Atkins. Whilst I know these aren't "ideal" competition diets by current convention, I have heard of ultra-marathon runners "fat-loading" to fuel them for their runs with great success.