I was recently asked, "How do you handle a hidden knife (a knife in the assailant's other hand)?" Defending against an unseen knife is practically impossible. This is true of any weapon, and assaults in general. No one can defend against something unseen. Since that is impossible, we must move to what is possible--defending against weapons we can see (or believe our assailant possesses). First, a general rule: Rush a gun; Run from a knife.
Within reasonable range and assuming you are not similarly armed, you rush a gun simply because you have no chance of controlling it if you are within the range of the weapon, but outside arm's reach. Since you cannot outrun a bullet, you might as well position yourself so you at least have a chance of controlling the weapon and possibly disarming your assailant.
On the other hand, you run from a knife because you want to stay as far out of your assailant's range as possible. (Few can throw a knife accurately anyway and only a dummy would do that if he had only one.) If flight is an option, and I can see or sense my opponent has a knife, I get the heck out of there. Not very macho, but very smart self-defense. (Macho or senseless and foolish bravado gets more folks killed and injured than anything else in a fight.)
If running is not an option (i.e. I must protect someone who cannot safely escape attack), then we close the gap quickly and, as with the gun, attempt to neutralize or disarm the assailant. As you might expect, since ours is a drill-focused school, we train the reflexes for both using and facing a knife via sombrada-range drills (see Knife Sombrada and Hand Sombrada). Once the basic flow is internalized (quite easy since both drills actually have similar movements and lines), we then mix them by having one player wield the knife while his partner remains unarmed.
In this mixed mode, the unarmed defender must not only avoid, parry, or otherwise deflect the weapon, but he must also concentrate on attacking the limb that is wielding the weapon (see Capturing The Limb). Essentially, this means setting aside your desire to strike your assailant in the face until after you've effectively neutralized his ability to even hold his weapon. (Then you can pound the creep in the face)
The basic drill pattern used in our sombrada-range knife, empty hand, and baton drills actually covers about 90% of the assault lines you're most likely to see. When mixing them, the disadvantaged player makes limb destruction his primary focus. Once his movements satisfy that, and to perpetuate the drill, the disadvantaged player then feeds his knife-wielding partner the counter punch or attack line he needs to continue the drill and train his reflexes as well.
Facing a weapon is terrifying, and if you are not afraid, you are either nuts or a fool. Still, these days weapons-based assaults are increasingly common and anyone who neglects this aspect of martial arts training is equally foolish.