Here is how I record guns:
I get the gun to a location which will not add it's own noise to the gun. I find a spot which has a good echo and decay that sounds neutral (i.e. no noticeable delay which will sound weird in different spaces, etc.).
I get a real nice, $6,000 condenser microphone like the Neuman 191 stereo mic and place that within inches of the gun's muzzle.
I have a pair of SM57s I set up about 5 feet away from the gun in an ORTF configuration.
I have a stereo pair of AKG 421s I place about 10 feet away from the mic set in an ORTF configuration.
I have a binaural mic placed about 15 feet away from the gun.
I set up about 50 feet away from the gun a pair of Schoeps MK5 mics which are set up in either XY or ORTF.
Sometimes we bring along the surround mic, but not always.
This gets enough coverage and enough options to get a gun sounding good.
The key to good gun sound and recording is having all of the perspectives you can mix and match with, and also capturing the decay of the gun (echoes) which is where most of the gun's body is in. Hence, the mics placed further away.
The FX recordist for Inception used a similar technique and got great sounding guns. So did the guns of The Town. As well as the guns for all of the Medal of Honor video games. But, the person I learned this from used this on the movie Transformers 1, 2 and 3. Those are the best I've heard.