There's some really good advice so far but I'll throw in a couple things that haven't been said yet.
One of the important things for home defense is that you can fire "instinctive", or over the sights (as opposed to through the sights) - lighting may not be ideal.
I carry a Heckler & Koch USP40 (Lara Croft gun) and/or a Smith & Wesson Airweight 38+P.
One thing I do to pick a good firearm is to aim it at a point on wall or somewhere without looking at the gun, then check to see if the gun is pointing where you wanted it. If so, then it fits your hand.
Auto or revolver is pretty much just personal preference - just don't go cheap.
Caliber? .380 for auto or .38 for revolver is the absolute smallest effective. Even a .223 rifle round isn't very effective. Whatever caliber, shoot center mass until the threat is mitigated (quits moving).
Also, think about keeping a good strong flashlight with the weapon for night use, like a Maglight. Use it copstyle, hold the light in the offhand, pinky towards the lighted end, rest the shooting hand wrist on your offhand wrist, curl the offhand wrist upwards so the backs of both hands are touching. Good stability and you are automatically aimed at the center of the light beam.
Oh and by all means, take a class, and practice often.
Good luck with the long lines at the gun store
