There are knife disarming techniques; heck, there's SWORD disarming techniques that go back hundreds of years. If it's possible to disarm someone who has a sword, it's possible to do likewise with a knife. I'm not talking about Kung Fu, either, although there's certainly disarming techniques in actual Chinese CQC; I'm talking about medieval European CQC.
These can be learned and applied. With that in mind, it's tempting to call guns the lazy man's self-defense, although I know that's unfair and untrue, since learning CQC can take a lot of time which not everyone has, and not everyone has a body type that's suited to the physical strain required.
Shooting to kill when there's no other immediate alternative (and searching for one will definitely get you killed) is acceptable, although I would personally perform some sort of ritual in addition to reporting to the police to stand trial. The best solution, then, is to determine alternatives in advance.