A Rifle is a long-barreled firearm with rifling inside the bore (hole) of the barrel. Rifling is the spiral design carved into the inside of the bore, which is designed to spin the bullet as it flies from the gun, which keeps it straight during flight and in turn promotes both accuracy and range.
The steel used for the barrel must be very hard, so the rifling does not wear down under the bullet sliding through at more than 900 miles an hour. However, the whole barrel must be carved from Tungsten bits, and the harder the steel, the faster the bits wear down, which both wastes bits as well as the fact it takes longer to machine the steel.
The steel most commonly used is numbered 4140. This is 1% Chromium, .4% Carbon, .25 % Molybdenum, 1% Manganese, and about .2% Silicon. This combination makes the steel fairly hard (not hard enough for knives though), hard enough to stay durable without rubbing to bits with every shot, yet soft enough not to lose the manufacturers thousands of dollars in bits.
For many military rifles, a similar steel, 4150, has started to be adopted. This is exactly the same as 4140, except 4150 has about .5% more carbon than 4140. This .5% makes the steel much harder, which is vital for the military as full-auto guns wear through the rifling pretty quick. After a couple of battles, soldiers’ shots would begin to be less accurate and have less range, which is not good, obviously. The army is willing to pay for the more expensive (due to the time and bits that are used up in the factory) steel for more durable guns.
(Reference Article: http://www.rifleshootermag.com/2011/12/29/guide-to-gun-metal/ )