In case I'm not being trolled: the way to defeat a radar-guided missile is to beam (fly perpendicular to) the radar source. For an missile with active or semi-active radar guidance, this means you need to fly perpendicular to it. And, preferably, fire lots of chaff.
This is fundamentally incompatible with the idea of flying straight at the missile trying to shoot it with guns. Head-on, a missile will close the last mile in under one second. During this second, you need to accurately track, predict the flight path of, and reliably put guns onto a target that's cold (all the fuel has been burnt) and has (in the case of an AMRAAM) a 7 inch diameter. And that very well may not even care about being shot up with bullets; at best, I think you'd kill the seeker, but within the last mile it's not changing course much to have to come close enough to kill you by the proximity fuze (of which I believe there are two, one in the nose and one in the tail). By the time the first of your slow-moving bullets has any shot of reaching it, it will easily be within a quarter of a mile.
This is not even a remotely plausible way to defeat an oncoming missile. It runs directly counter to the actions you already be taking to maximize your chance of survival. And on top of that, bullets are only going to damage the leading-edge parts of the missile which aren't particularly critical to its ability to kill you, at least not within the distance it will be by the time your hail-mary bullet salvo hits it.