I'm not going to list my experiences and background with firearms, because at least a few people won't believe me. And it really doesn't matter. But I will share my thoughts on the subject:
The best defensive firearm is the one that you are A) comfortable enough to practice with, and can B) consistently, reliably hit the target with. Go to an indoor range that rents guns and try a variety of firearms and calibers. It'll be money well-spent. Hitting a criminal several times with a little bitty 22 will do more damage than missing him with a 45.
At minimum, I would recommend 38 Special +P for home defense use. Usually, for someone who is inexperienced with firearms, I recommend a revolver as a first handgun because it's much easier to operate. The downside is that you have fewer rounds than you would with a high capacity semi auto, but in the real world, most gunfights are over in just a few seconds.
Unless you have practiced extensively with a Sig, Glock, etc and can handle jams, failure to fire, etc in the dark without thinking about it, you're probably better off with a good revolver. A pump action shotgun is also a good choice as suggested by other posters, but you still have to aim.
If you have a good quality 38/357 magnum revolver at your bedside, and can ACCURATELY put those 5 or 6 rounds (or 7 with newer models) into the intruder, then the fight will be over quickly. All the comments about overpenetration of walls, etc won't matter if you put your shots into the criminal.
If you want to learn about clearing your house alone, combat tactics, etc, then go to a place like Thunder Ranch and get trained. Otherwise, just practice with your chosen sidearm and become proficient at putting lead where you want it to go.