Side note: In a gun situation, running bent over in a zig-zag fashion apparently works pretty well, keeping to cover as much as you can. Most people can't aim well with a pistol beyond, say, 20 metres so once you make it to that distance you're a bit safer, unless they're a sharpshooter. Secondly, I'd say get out of line-of-sight as quickly as possible. If they can't see you they cant shoot you can they?
Of course if you're close enough, you could try a disarm but that's going to be pretty risky. I personally think that at extreme close range a knife is probably more dangerous than a pistol, and certainly more dangerous than a rifle (as long as there's no bayonette).
(Website by Marc MacYoung, not me)