Carry a patch kit and know how to use it. The number of flats you will have on any given ride is the number of spare tubes you have, plus one. 
Stick-on patches are quickest, simplest and most compact for the road. I'm told they're not as reliable as the old-school patches though - I've never had a glued patch fail [touch wood].
If you have enough spare tubes to get you home, then use the glue type to patch them. It's a whole lot easier to find small holes and patch them when you have access to a pail of water and clean towels! Let the glue cure overnight before you fold them back up for your seat pack. When you pack it up, use extra powder, since any excess glue will be even stickier than the tube itself.
Speed comes from what you put behind you. - Judi Ketteler