Stephen has a good start.
1. Only try to disarm the attacker as a last ditch effort.
2. Even skilled martial artists got shot most of the time.
3. Control the weapon if possible.
4. Learn some "proven" techniques and PRACTICE.
5. Do not assume that the attacker will be debilitated with your strikes.
Now add this:
Your attack must be spontainious. It must not be telegraphed. It must be a suprise to the gun welder.
When grabbing for the weapon, ALWAYS
look away from the muzzle of the gun. If it goes off, the blast of gunpower is going 20,000 fps (for a very short distance) and that is enough to blind you from the particals if you are looking at the muzzle.
Move in such a way the weapon will not be pointed at you AND any innocents (hard to do!) Keep in mind there may very well be others present and they will be in danger from the gun's muzzle.
Once you start the ball rolling, DON'T STOP AND DON'T LOSE CONTROL OF THE WEAPON! Go all out and never give up.
I have found some of the Krav Maga methods are quite good. Any method that takes more than three moves or expects certian behavior from the one you are disarming is bound to fail. You will be dealing with a thinking resisting human and it will be a fight for your life!