First off, I am thrilled to see this much excitement over firearms in a medical thread. I am currently a third year medical student and to my chagrin, most people at my school tend to have certain preconceptions about the possession of firearms. I have been shooting since I was a child and have been collecting for 5 years or so now and have accumulated a lot of experience with the variety of firearms out there.
The decision to purchase a handgun should start deciding the purpose of the firearm. Exclusively a night stand gun? Will you ever want to carry it? Who in the household may want to shoot it? Are you left handed and want a firearm with ambidextrous controls? You should next determine if you want a firearm that is a single action, double/single, or striker fired. They work differently and have different trigger pulls. Some have manual safeties, some do not. Ammunition cost is a realistic factor that will affect how much you shoot. While 22 LR (long rifle) is a great round to learn on, rimfire rounds are not appropriate for self defense purposes. Rather, choose a centerfire cartridge. 9mm is a great choice to start. When purchasing in bulk, rough costs are $10 box of 9mm, $14 of .40 SW, and $17 of .45 ACP. Calibers like 10mm have excellent terminal ballistics and are fun to shoot, but do not make sense unless you are reloading.
I have over 20 firearms including handgun models from HK, Sig, Smith and Wesson M&P, Glock, and Walther. Shotguns and rifles/carbines too. I recommend a Glock 19 (generation three is good to go). It is striker fired which means there is no external hammer and no external manual safety to be concerned about in a moment of stress. They are light, very concealable, and still carry 15 rounds in each magazine. They are also capable of running the larger Glock 9mm 17 and 33 round magazines. Striker fired guns allow you to shoot every shot with the same trigger pull. This is in contrast to the Sig or HK (depending on the version) that come standard in a double action/single action configuration. Do yourself a favor and shoot both. The majority of police departments in the US run Glocks in 9,40, and 45 followed by Sig. Some agencies use Berettas, Smith and Wesson M&P, or HK. Few agencies shoot 357 Sig ammunition or 10mm.
A Glock 19 will allow you versality and is a great place to start. I would feel comfortable trusting any of my firearms with my life, but if I could only have one it would be a Glock 19.
Remember, for home defense, be careful if you live in an apartment or in a home close to your neighbors because 9mm will zip through dry wall. Shotguns are excellent and versatile firearms too, but really not appropriate for life in a condo. If you want a shotgun, Remington's 870 series and Mossberg's 500 and 590 series are excellent places to start with reasonably priced models. Whatever you do, make sure you get a model with a buttstock. Shotguns do not aim themselves, contrary to popular belief.
Don't forget a good holster and a gun belt. If you keep the firearm as a night stand gun, a Surefire or Streamlight weapon light are also nice accessories. Best of luck in your decision.