The grim instant a boat's keel bumps bottom could signal the beginning of a catastrophe or, if you're lucky, a momentary scare. The typical grounding is somewhere in between, and getting the boat back to open water usually involves a lot more skill than luck.
Generally, if the boat is going to be freed quickly the skipper has to react instantly to the initial bump. When a boat is sailing upwind, the helm should be thrown over immediately and the boat tacked. Crew weight should be moved to leeward to reduce draft and then, hopefully, the wind will nudge the boat back to open water.
If the boat is sailing downwind, the chances of getting free immediately are slim unless you happen to have bumped a very short shoal. The temptation will be to try and spin the boat 180 degrees so that it's heading back toward open water. This may work, but be forewarned that it could also damage your rudder, especially a deep, spade rudder. If the boat remains on the shoal, drop the sails immediately so that it won't be blown further into shallow water.
Whether you get free quickly or not, anytime your boat bumps bottom check the bilges for rising water. If the keel bolts were loosened and leaking badly, or if the boat was holed, man the pumps and call for assistance immediately. (Claims involving heavy damage as the result of a grounding, fortunately, are rare.)
Your next step, if you're aground, is to take soundings of the surrounding bottom so you'll know what you're up against. Use a lead line or boathook to measure water depth around the boat and, if possible, get in the dinghy and take additional soundings further away from the boat. While you're probing, find out what type of bottom the boat is stuck in. Boats aground in mud may have to be rocked from side to side to break the suction.
Whatever tactics you employ to free the boat should be based in part on the boat's design. A light displacement boat with a shoal draft can probably be shoved to deeper water by the crew (wearing shoes!). If you own a centerboard boat, merely raising the board may do the trick but be careful not to back the engine without first raising the centerboard. A boat with a full keel and a cutaway forefoot can sometimes be refloated by moving the crew forward. Fin keel boats, on the other hand, are most likely to be refloated when crew weight is moved to the rail. Which rail depends on where the water is deepest; the keel should be pointing toward deeper water. To gain another degree or two of heel, try swinging the boom out with one or two volunteers clinging to the end.
If you use your engine, make sure it's pumping water. When a boat is heeled, the intake could be out of the water or, equally as serious, sucking up sand, mud, or gunk from the bottom. Check periodically to make sure water is flowing freely from the exhaust and keep an eye on the temperature gauge.
Setting a Kedge
If you've checked water depth, shifted weight, gunned the engine, etc. and the boat remains stuck, you've got some work to do before resuming your quest (and by now it will have become a quest) to get the boat free. Setting a kedge (anchor) out in deeper water can help free the boat and will also prevent it from being nudged further up onto the shoal. If a dinghy is available, the anchor should be hung on the stern and the line flaked in the boat so it will pay out smoothly as you row. If you don't carry a dinghy, the anchor can be floated out using fenders, PFDs, or seat cushions. You'll want at least a 3:1 scope.
Sailboats typically have a multitude of winches, which gives you extra muscle kedging off. One proven trick involves running the halyard over to the anchor line and using the halyard winch to heel the boat. This is a little scary (it seems like the weight of the boat is concentrated at the masthead), but the technique has a good chance of working if the boat isn't too hard aground or you don't yank the anchor out of the bottom. When and if the keel floats off, use the engine to work the boat out to deeper water.
Snatch blocks can also be used to lead the anchor line from the bow to the largest winch aboard, which is usually at the cockpit, so that the boat can be "pulled" out to deeper water. One winch that shouldn't be used is the electric anchor windlass, which isn't designed to operate under heavy loads. A manual winch, on the other hand, will give you a terrific mechanical advantage pulling the boat out to deeper water.
If you can't pull the boat off, at least try and get the bow headed back toward deeper water. (Again, be careful if you have a spade rudder.) You may then be able to use wave action and wakes together with your engine to free the boat.
Finally, if the boat is really stuck, you can try lightening the boat. Empty the water tanks and double check the bilge to make sure it's dry. One square foot of water weighs 64 pounds. Put heavy objects--anchors, spare batteries, chubby kids, etc. into the dinghy temporarily. If you're anywhere near land, you may opt to use the dinghy to carry heavy gear ashore.
It could be that after the tide has come and gone, you'll still be stuck. You've tried everything, from heeling the boat to setting out a kedge, and the boat won't budge. More than one skipper has gone a little bonkers and started randomly tossing things overboard. This is not advised. Sometime later, in a moment of quiet reflection, you'll wish you hadn't. A better option, when all else has failed, is to call for commercial assistance (consult your BoatUS Guide to Towing Companies). And next time remember to pay more attention to your charts.
Whenever you go aground, tide, if any, is an important consideration. If you're lucky (there's that word again), the tide will be low and rising quickly. If it's anywhere near high tide, however, you'll have to work quickly. Consult your tide tables and/or jam your boathook into the bottom next to the boat and mark the water level with tape. One old salt on the Chesapeake, with a fondness for gunkholing (and a penchant for running aground), doesn't start working in earnest to free that boat until he sees the water has risen an inch or two above the tape.
The tidal range in some areas is such that a falling tide could leave the boat high and dry, and if this is the case you'll want to put seat cushions, fenders, or PFDs, etc, against the hull to protect it from gouges. (Tip: Try stuffing the cushions or PFDs in an old sail bag so they won't get smeared with mud and bottom paint.) Things to check if the boat will be laying on its side include the battery, fuel vents, engine oil dip stick, and gas bottles. The latter should be shut off to prevent pressure from building up in hoses.
A boat resting on level ground isn't in danger of being flooded by the incoming tide. On the other hand, if it's aground on the side of an underwater hill, you'll want the keel pointing downhill so that the lower rail is away from the incoming tide.