To my way of thinking, the best gun for home defense is (drumroll please) ... the gun you can get to in a hurry and use efficiently.
Whether or not that's a shotgun, a rifle, or a handgun depends entirely upon you and your own unique circumstances. For me, it's a handgun, and you can find the long-winded reasons at this link:
http://www.corneredcat.com/FirstGun/handgun.aspx
pax