As stated, bluing is a controlled form of rust. Chemical bluing as detailed above is best left to a pro.
An alternative is slow rust bluing which can be done at home, is cheap and gives a wonderful finish. The down side is that the process is time consuming and requires attention to detail and cleanliness.
The process is to prep the metal by either polishing, buffing or blasting , depending on the lustre of finish desired. The metal is cleaned with a degreaser to remove ALL the oils and greases that are in or on the metal.
Once the metal is prepped, a bluing chemical is appied to the metal and the metal is placed in a warm, humid place for 6-12 hours. During that time a fine red rust will form on the metal. When the time has elapsed, the metal is boiled in distilled water for 10-15 min. The boiling creates a chemical reaction that turns the red rust to a black rust. After boiling, the metal is rubbed down(carded) with ultra-fine, degreased steel wool and the process repeated 6-8 times(ie apply chemical, allow to rust, boil, card)
After the last carding, submerge the metal in oil for 24 hours.
The finish is beautiful and is one of the toughest finishes that can be applied to a firearm.