While most who worry about self-defense with a gun don't really want to shoot someone, hoping that displaying a gun will end the fight and make the attacker go away may be a "false trail". The same applies to firing a warning shot.
No, the unfortunate truth is that you need the largest gun you can comfortably shoot, so that the attack is stopped.
If you can't stop the attacker, and you have a gun (even your favorite .22), the next thing that happens is he takes it away from you. Now he does whatever he feels like...
For this reason, "straight talk" often includes something like, "If you can't summon the resolve to use a gun to save your own life, don't carry one."
So, while all the technical discussions of caliber, revolver vs. semiauto, handgun vs. shotgun, etc. are correct, I believe the first question you need to answer is, can you use a gun to save your life?