Bronze is an alloy of copper mixed with some other elements. Early types of bronze consisted of copper mixed with a small quantity of arsenic ("arsenical bronze"). It seems to have occurred some time after man learned to melt copper. It is theorized that some unknown potter in Eastern Europe or Asia Minor discovered that heating certain rocks in a potter's kiln produced a metal (copper) that could be used for tools and jewelry. About 1000 years after the discovery of copper smelting, we find evidence of people in the Balkans melting copper and arsenic together to form bronze around 4200 BC. Since some copper bearing minerals also contain some arsenic as impurities, the discovery of bronze might have been an accident, but there is evidence that people later deliberately began to add arsenic to copper to make bronze. Another 1000 years or so later, in 3200 BC, we begin to see the use of tin and copper to make bronze as well. Again, this may have been a lucky accident as well, as some copper ores to contain a little bit of tin, but we also see that by 2000 BC, people were mining tin bearing minerals deliberately in England, France, Spain and Portugal. It is interesting to note that tin from England has shown up in bronzes found in the Mediterranean and Near East. In fact, given that tin is not a common metal and deposits are only found in a few places in the world, the trade in tin to be used in bronzes established some of the earliest international trade routes.
Now we skip past the bronze age and past the iron age as well, into China around 1290 AD, where both gunpowder and cannon were invented and in use. The earliest Chinese cannons were made of bamboo, but they later started to make them out of metal and the metal of choice was bronze. Cast iron and wrought iron were also known to the Chinese at this point, but the early metal cannons made around 1300 AD were all found to be made of bronze. Even though bronze was more expensive than iron, the reasons for using it were probably because bronze is stronger than wrought iron and not as brittle as cast iron. It is also far more resistant to corrosion than iron is and is easier to cast into barrels.
Bronze Chinese hand cannon from the Yuan Dynasty (1271-1368 AD). Click on the image to enlarge
Image licensed under Creative Commons Attribution-Share Alike 3.0 Unported license by Yannick Trottier.
When firearms technologies reached Europe, many of the early European firearms were also made of bronze. Bronze cannon continued to be used in America as well. In fact, during the Civil War, a majority of the field artillery used by both sides were made of bronze. While cannons made of iron were also invented, people continued to use bronze cannons for a while after for several reasons. Even though cast iron guns can withstand greater amounts of gunpowder and thereby have greater range, bronze cannons are lighter for the same caliber. Therefore, they were preferred for campaigns, as they could be moved around more easily. On ships, bronze firearms (both small arms and cannon) were preferred over iron mainly because bronze doesn't corrode as easily in the presence of sea water.
A pair of bronze barreled travelling pistols from England circa 1803-1820
Gunmetal is one of the strongest types of bronze used to make guns. It dates back to the middle of the 19th century, when it was discovered that adding a little bit of zinc to bronze improves its casting characteristics. The British Admiralty gunmetal formula was 88% copper, 10% tin and 2% zinc, whereas the US Ordnance formula was 88% copper, 8% tin and 4% zinc.
Interestingly, even though literature from the 18th and 19th centuries refer to brass firearms, many of these were actually made of bronze (i.e. alloy of copper and tin) rather than brass (which is an alloy of copper and zinc). Examples include the Henry rifle and several confederate weapons, which are often mentioned to have brass frames, when they are really more bronze than brass.
Winchester Model 1866 rifle
The above image shows a Winchester Model 1866 rifle (a.k.a. the improved Henry rifle), sometimes called the "Yellow Boy", because of the color of its receiver. Although some sources call it a brass receiver, chemical analysis shows that it is actually a gunmetal of 83% copper, 14.5% tin, 2% zinc and 0.5% lead.
While bronze was used for firearms for quite a while, it was always more expensive than iron and less strong. With the rise of modern steel making techniques, it became possible for steel to overcome the advantages that bronze had over iron (i.e.) ease of casting, elasticity and corrosion resistance. This is why bronze stopped being used for firearms, as improvements in steel manufacturing and improved casting and machining techniques were discovered.