The only thing I'll add is that it's often times the reaction to the condition which causes the accident. Whether you overlap wheels with the rider ahead of you or drop a tire into an expansion crack, it's the reaction that causes the accident.
Here are a few of the things which have worked for me:
Relax. You have a significant amount of momentum, and if you can keep light on the front end (see "Sand Riding" below), the crack shouldn't stop you (especially if you have real world tires (30mm or above) on the bike. Hitting the brakes (remember, 80% of your braking is on the front wheel) makes bad things happen very fast.
Sand Riding. When you ride in soft sand, the only way to stay upright is to get all the weight off of your front wheel and essentially surf through the drift on the back wheel. (steering with your hips, unicycle style). If you dump the front wheel into a rut get your weight back, back, back, back, back. The dangerous tendency is to shift forward (if the rut is nasty enough to cause a reduction in speed, this is already happening) and muscle the front wheel out. I've found that if you can get waaaaaay back, you can essentially wheelie out, rather than steering out.
Countersteering. Not Just a Good Idea - It's the Law. There are two times when almost every rider forgets that a bike steers by countersteering - (a) when you are on the edge of the roadway or (b) when you drop into a rut. Let's take the roadway edge first. You are on the right side of the road and there's a ditch to your right. The shoulder suddenly disappears and you find yourself within a couple inches of a steep drop. First reaction is to turn the bars left. This, of course, makes the bicycle go right - towards the ditch, so you lean for all it is worth to your left. This counteracts the steering action and all that happens is you keep plowing along straight, inches away from the drop. You get more and more tense and keep turning the bars left, while leaning left. Frivolity ensues.
With a rut, it can be a bit trickier, but let's assuming you stay relaxed and unweight the front wheel. If you turn the bars left, the bicycle will want to go right, so what can happen - in unfortunately short order - is that the front wheel pops free on the left side of the rut, then the bicycle/rider combine goes right, dropping the wheel back into the rut, causing a panicked reaction and some manner of tumbling to the unforgiving roadway. (This works the other way as well - even though the bicycle at first gets free, the great surprise is when the front wheel heads back for the rut as if drawn by a magnet.) You have to be ready to hop the wheel over or stay front-end-unweighted until all the bits are are the same side of the rut.
Relax and Ride it Out. Unless you are in a group and someone is drafting very, very close to you, sometimes the best strategy is just of stop pedaling, lean back and let momentum take over. In off road conditions in my area, some trails are affected by seasonal rains, and you can find yourself in a significantly deep drainage rut. I have been stopped by wedging my pedals against the side of the rut. Not purposefully doing that, by the way... But, on the roadway, if you don't overreact to the situation, momentum covers a lot of ills. You may find yourself expelled from the rut, or just stopping.
Now - disclaimer time - most of these things were learned by trial and failure*. It takes a lot of practice to override your immediate reactions. The ground is hard.
But, the first key to staying upright is being able to relax on the bike - grass drills (where you tussle and prod the rider next to you while riding on a soft, forgiving surface) and just playing on the bike - seeing where your balance issues are, doing the wrong thing and seeing if you can recover, super slow speed navigation - will serve you well.
hope that helps,
- Jim /
cyclofiend.com /
cyclo...@gmail.com* and I will say this is one place where racing experience can help. CX maneuvers in hellish weather, MTB racing, and of course the dreaded high speed crit pack all do help your handling skills. Though the price for failure in those areas is a bit steeper.