The only way to stop a bad guy with a gun is a good guy with a gun... In an action movie, in real life, there's kinda too much chaos going on for anyone to differentiate between the "bad guy" and the "good guy", or for the "good guy" to know the situation.
I've heard of more times where someone tried to play hero and was gunned down by the police who mistook him for the real shooter than I have any reports of "Hero Gunman slays horrible villain"