At a minimum, you need:
You can get a lot fancier than this, but this will function perfectly as long as you are there to do the switching soon enough after power fails that your building doesn't get too close to pipe-freeze (I wouldn't want to go below 40 degrees f, pipes are often in walls that are cooler than the rest of the house.)
If that won't do, you're looking at an auto-start system with an auto-generator switchover, and the only thing I can tell you about that is prepare your wallet for deep excavation.
Sorry, fyngryz; but your reply needs to be downmodded for "Overkill", and "FUD".
Step 1) Buy a genset. Get 6000 watts or better, if you can afford it. Make sure it has a 220V twist-lock outlet on it, in addition to the usual dual-120V outlets.
Step 2) Buy a nice length of fat extension cable (10AWG or bigger), with a male twist-lock on one end, and a male dryer plug on the other. Your Home Depot or local electrical supplier can make it up for you if you lack the boxcutter-and-screwdriver skills necessary to assemble it.
Step 3) Bring it all home, fill the genset with gas. It will probably hold something like 20 litres (as you're in the States, I'll convert for you: ~5 gallons).
Step 4) Go to your breaker panel, and shut off the MAIN breaker, as well as any baseboard heaters and your hotwater tank. Those will all be 220V breakers (the double kind). Leave all the rest on, if you like. If you have sensitive electronics, feel free to shut off those breakers or unplug the devices- which you've probably already done anyhow, since when your lights went out, there was an accompanying surge which melted all your power bars, right?
Step 5) Plug the large plug into your dryer outlet. Yes, it might be awkward to reach. If you have the money and time, get an electrician to install a 220V dryer outlet on the outside of your house somewhere near where you'd park the genset. Your choice.
Step 6) Start the generator. Once it's running smoothly, plug the twist-lock in. If it stalls out right away, the chances are you forgot to shut off your mains breaker and are trying to feed power back onto the grid.
Step 7) Go inside and enjoy your warm, well-lit household. By being careful, you can use all the major appliances in your house, including your range and oven. If you run out of hot water, lower the rest of your load and turn the tank back on for a while. Just don't try and bake bread while your water tank is on (typical load for a hotwater tank is 3KW). You'll get a feel for it- if the generator bogs down really bad, it means you're overloading it. Back off a bit. Worst thing you can do (provided your extension cable is properly gauged) is stall the genset.
Step 8) In about 8 hours, go outside and feed the genset some more gas.
This response by fyngryz is ludicrous. Even in a professionally-installed backup power system, you never run feeds to each device, you merely use an automatic switch to shunt the mains from the utility to your genset. If you have money to burn, you shell out the $12,000 it costs and have a proper diesel or propane-powered generator installed (you don't need a shed, they come in their own housings these days). It will have an automatic starter so that within 3-5 seconds of the power failing, you'll be on backup.
When I lived in an isolated seaside village in northern Canada, where the power would go out regularly for days at a time, it would take me less than 3 minutes to bundle up, wade through the snow to the woodshed, pull the genset outside, plug in the cord, run it in through the back door to the dryer outlet, and be lights-on and surfing the web again. Backup power is NOT magic or scary or even expensive- you can get a 6KW genset for $500, brand new, add a couple hundred if you're lazy and want electric start.
Truth has always been found to promote the best interests of mankind... - Percy Bysshe Shelley