While I'm not going to put down a good handgun and I think you should one, I do believe you should be able to protect yourself from folks who are armed with a rifle. I'm not going to advise you which one to purchase, but it should be one with a high enough caliber to be accurate and lethal at 100 yards.
This would not be advisable at any time other than during a riot when someone is firing on you or trying to torch or enter your dwelling. The rules are a little different under those conditions (not literally, but with some vague understanding IMO). Don't think that you will get a free pass, if you do defend yourself. You might not.
The handgun would cover you in the event of an intruder. I would recomment hollow point ammo as it might be less likely to exit your home and enter another. It also has good stopping power.
Others will give you great ideas on which exact weapons to buy.
A "California Assualt Carbine" (AKA a Marlin .30-30 lever gun) is a swell tool.
But, a lot of folks, if they had to choose only one gun to defend hearth and home, would want a good 12-ga pump with an assortment of ammo.
A rifled slug will give you the 100 yard accuracy you specify in your post.
Add in buckshot for other outdoor work, and, if you want, birdshot for inside applications, and you've got a tool that will solve just about any problem one man can solve on his own. All for less than 300 bucks!
Of course, one of the great things about firearms is that they are perfectly happy if you have more than one. They don't get jealous of each other, and as long as you keep 'em clean, they never nag or complain. So get some shotguns, and some rifles!