The Doctor has carried a gun on several occasions. The Third Doctor carried (& used) one in "Day of the Daleks". The Ninth Doctor carried (but didn't use) one in "Bad Wolf". The Tenth Doctor carried one in "The End of Time" (though only once he knew the Time Lords were involved in what was happening). The War Doctor (the one between the Eighth and Ninth) carried a gun in "The Day of the Doctor", Doctor Who's 50th Anniversary Special.