If someone invades your home at night with bad intentions, you want a shotgun, not a handgun. Handguns require accuracy, which is difficult, especially in low-light conditions. Shotguns require little. Just point and shoot.
Now let's say that the intruders are federal agents, like the ones who murdered that family in Ruby Ridge, Idaho. In that scenario, you'd want a rifle with a scope to make sure you could accurately shoot the trespassers. A shotgun would be ineffective at range and a handgun isn't very accurate at more than 50 yards.
Edited by HobnailedBoots, 16 January 2013 - 08:41 PM.