When you are exercising, you sweat out water and sodium. One quart of sweat contains 200 to 800 mg of sodium—the more acclimated you are to hot conditions, the less sodium in your sweat. When you are doing a long endurance ride and sweating a lot, you could lose as much as 10 grams of sodium. If you drink too much fluid at the same time as you are sweating out sodium, you could reduce the sodium concentration in your blood to a dangerously low level known as hyponatremia. Drink enough that you aren't thirsty, but don't try to drink a pre-determined amount every hour.
Sodium is the primary electrolyte in sweat and losing too much sodium is one of the causes of cramps as well as hyponatremia. During rides over four hours the ACSM recommends supplementing with sodium.
So-called electrolyte replacement drinks contain some sodium, but not enough to replace what you are losing in sweat—if they did, they'd be unpalatable. Sports nutrition companies sell electrolyte replacement products--some are effective if they contain enough sodium—check the ingredients. Again, real food is the answer: V-8 and tomato juice, deli turkey, dill pickles and pickle juice, and most crackers, chips and pretzels are excellent sources of sodium.
One of the keys to a successful ultra ride is to test everything in training. This applies not only to your equipment and pacing, but also to your nutrition. Use your training rides to figure out how many calories you need to consume without bonking and how much you can eat without bloating. Experiment to find out which foods sit well in your stomach while exercising. Learn what foods you can eat hour after hour and what you need for variety.
Before an ultra event, try to find out what the organizers will be providing at the rest stops. Hopefully, they'll provide much of what you like. However, if they don't, then carry your own food. For example, they may not serve the type of electrolyte drink you like—take powder and make your own.
After the Ride
Good nutrition is one of the keys to recovery. As you are finishing the ride, consume any food and drink that you still have with you. As soon as you get off the bike start eating primarily carbs and continue snacking until you sit down for a regular meal. If it's been hot choose salty snacks. As noted above, drink plenty of water, 1.5 times what you've lost in sweat.
Eat to Ride or Ride to Eat?
Some ultra riders eat to ride. They view food as fuel and focus on eating enough to reach their goal of setting a personal best time, finishing a particularly arduous ride or pedaling farther than ever before. Other ultracyclists ride to eat. They enjoy eating a variety of foods both before and during events. They take a little extra time at rest stops to enjoy the offerings and talk with other cyclists.
Whatever your motivation, eat, eat, eat. A sport that encourages you to eat is a great sport!Search for a cycling event.