12 ga for a number of reasons I won't go into here, but a 20 ga is fine if you run into a good deal on one. Usually 20 gauge guns are actually more expensive than 12s, just because they're not as popular.
You can't go wrong with a pump, but be sure you're getting a design with double action bars. If you want the best, hands down, it's Remington 870, and an older used one is fine (some say even better than a new one). If you want to go cheap, look for a used Mossberg 500. It's about 80-90% the gun the Rem 870 is but can be had for as little as half the price (used), which is a good deal. Either gun will do the job, the Rem's just a bit smoother and more solid feeling. Some like that, including me (I own both kinds).
If you're buying used, don't worry too much about what barrel's on it if the price is otherwise right. You can swap on another barrel easily, and used barrels are often quite cheap too. If you get a barrel without a rib, you can saw it off yourself to a handy but legal length--somewhere between 18 1/2 and 20 inches.
If you want an extended magazine, the Remington is the better bet. Several different companies make bolt-on long mags for it. The extended mag on the Mossberg is pretty much a dedicated proposition--you have to buy it that way, and then your choice of other barrels for that model is very limited.
For sights, I like a simple tritium bead, which any competent local gunsmith can install, even if you've chopped the barrel. Forget about fancy "ghost ring" sights. You simply won't need them for home defense.
For ammo, my friend Mas Ayoob recommends #1 Buck as the best compromise, but it's hard to find. #00 is much more common. #0 and #4 Buck will also work, if that's what you find.
But buckshot ammo is expensive. Another way to go is get the biggest "cheap hunting" ammo you can find, which will probably be #2s or BBs. Either will work fine.
DO stay with a full stock. You don't want one of those pistol-gripped backbirths, no offense to those who like them. :wink:
Thus endeth the lesson. :wink: