The first step: Immediately cut the power by removing the battery. I know it's tempting, but resist the urge to power up your phone to see if it works--just turning it on can short out the circuits. If you have a GSM phone (the type used by AT&T and T-Mobile), you'll want to remove the SIM card as well. Even if your phone turns out to be beyond repair, the SIM should retain a lot of its onboard information, such as the contacts in your phone book.
With the battery safely set aside, you now have one goal--dry your phone, and dry it fast. If you let the moisture evaporate naturally, the chance of corrosion damaging the phone's innards increases. Instead, blow or suck the water out. But don't use a hair dryer--its heat can fry your phone's insides. Instead, opt for a can of compressed air, an air compressor set to a low psi or a vacuum cleaner (a wet/dry Shop-Vac would be perfect). The idea is to use air to push or pull moisture out through the same channels it entered.
Finally, use a desiccant to wick away any leftover moisture. The most convenient choice is uncooked rice. Just leave the phone (and its disconnected battery) submerged in a bowl of grains overnight. If you're worried about rice dust getting inside your phone, you can instead use the packets of silica gel that often come stuffed in the pockets of new clothes. But acting fast is far more important than avoiding a little dust, so don't waste time shopping if you don't already have a drawer full of silica gel.
The most important thing to remember is to avoid heat. That means no hair dryers, ovens, microwaves or extended periods in direct sunlight. While heat will certainly evaporate the moisture, it could also warp components and melt adhesives. Those fragile glues are also why you'll want to avoid dunking the phone in rubbing alcohol (an oftÂprescribed tip on the Web). Alcohol is a solvent and can dissolve the internal adhesives. (If you drop your phone in the toilet, it's okay to wipe the outside with alcohol to disinfect it.)
One final, perhaps surprising, note: If your phone gets soaked in salt water, you should probably flush the whole thing in fresh water before it dries. When salt water evaporates, it leaves crystals that can damage a phone's fragile components. Just be sure to remove the battery before flooding the device.