Flame
A flame (from Latin flamma) is the visible, gaseous part of a fire. It is caused by a highly exothermic chemical reaction taking place in a thin zone. When flames are hot enough to have ionized gaseous components of sufficient density they are then considered plasma.

Mechanism
Color and temperature of a flame are dependent on the type of fuel involved in the combustion, as, for example, when a lighter is held to a candle. The applied heat causes the fuel molecules in the candle wax to vaporize (if this process happens in inert atmosphere without oxidizer, it is called pyrolysis). In this state they can then readily react with oxygen in the air, which gives off enough heat in the subsequent exothermic reaction to vaporize yet more fuel, thus sustaining a consistent flame. The high temperature of the flame causes the vaporized fuel molecules to decompose, forming various incomplete combustion products and free radicals, and these products then react with each other and with the oxidizer involved in the reaction of the following flame (fire). One may investigate all the different parts of the flame from a candle with a cold metal spoon: Higher parts are water vapor, the result of combustion; yellow parts in the middle are soot; down just next to the candle wick is unburned wax. Goldsmiths use higher parts of a flame with a metallic blow-pipe for melting gold and silver.  Sufficient energy in the flame will excite the electrons in some of the transient reaction intermediates such as the methylidyne radical (CH) and diatomic carbon (C2), which results in the emission of visible light as these substances release their excess energy (see spectrum below for an explanation of which specific radical species produce which specific colors). As the combustion temperature of a flame increases (if the flame contains small particles of unburnt carbon or other material), so does the average energy of the electromagnetic radiation given off by the flame (see Black body).
Other oxidizers besides oxygen can be used to produce a flame. Hydrogen burning in chlorine produces a flame and in the process emits gaseous hydrogen chloride (HCl) as the combustion product. Another of many possible chemical combinations is hydrazine and nitrogen tetroxide which is hypergolic and commonly used in rocket engines. Fluoropolymers can be used to supply fluorine as an oxidizer of metallic fuels, e.g. in the magnesium/teflon/viton composition.
The chemical kinetics occurring in the flame are very complex and typically involve a large number of chemical reactions and intermediate species, most of them radicals. For instance, a well-known chemical kinetics scheme, GRI-Mech, uses 53 species and 325 elementary reactions to describe combustion of biogas.
There are different methods of distributing the required components of combustion to a flame. In a diffusion flame, oxygen and fuel diffuse into each other; the flame occurs where they meet. In a premixed flame, the oxygen and fuel are premixed beforehand, which results in a different type of flame. Candle flames (a diffusion flame) operate through evaporation of the fuel which rises in a laminar flow of hot gas which then mixes with surrounding oxygen and combusts.

Color
Flame color depends on several factors, the most important typically being black-body radiation and spectral band emission, with both spectral line emission and spectral line absorption playing smaller roles. In the most common type of flame, hydrocarbon flames, the most important factor determining color is oxygen supply and the extent of fuel-oxygen pre-mixing, which determines the rate of combustion and thus the temperature and reaction paths, thereby producing different color hues.

In a laboratory under normal gravity conditions and with a closed air inlet, a Bunsen burner burns with yellow flame (also called a safety flame) with a peak temperature of about 2,000 K (3,100 °F). The yellow arises from incandescence of very fine soot particles that are produced in the flame. Also, carbon monoxide is produced, and the flame tends to take oxygen from the surfaces it touches. When the air inlet is opened, less soot and carbon monoxide are produced. When enough air is supplied, no soot or carbon monoxide is produced and the flame becomes blue. (Most of this blue had previously been obscured by the bright yellow emissions.) The spectrum of a premixed (complete combustion) butane flame on the right shows that the blue color arises specifically due to emission of excited molecular radicals in the flame, which emit most of their light well below ≈565 nanometers in the blue and green regions of the visible spectrum.
The colder part of a diffusion (incomplete combustion) flame will be red, transitioning to orange, yellow, and white as the temperature increases as evidenced by changes in the black-body radiation spectrum. For a given flame's region, the closer to white on this scale, the hotter that section of the flame is. The transitions are often apparent in fires, in which the color emitted closest to the fuel is white, with an orange section above it, and reddish flames the highest of all. A blue-colored flame only emerges when the amount of soot decreases and the blue emissions from excited molecular radicals become dominant, though the blue can often be seen near the base of candles where airborne soot is less concentrated.Specific colors can be imparted to the flame by introduction of excitable species with bright emission spectrum lines. In analytical chemistry, this effect is used in flame tests (or flame emission spectroscopy) to determine presence of some metal ions. In pyrotechnics, the pyrotechnic colorants are used to produce brightly colored fireworks.

Temperature
When looking at a flame's temperature there are many factors which can change or apply. An important one is that a flame's color does not necessarily determine a temperature comparison because black-body radiation is not the only thing that produces or determines the color seen; therefore it is only an estimation of temperature. Other factors that determine its temperature are:

In fires (particularly house fires), the cooler flames are often red and produce the most smoke. Here the red color compared to typical yellow color of the flames suggests that the temperature is lower. This is because there is a lack of oxygen in the room and therefore there is incomplete combustion and the flame temperature is low, often just 600 to 850 °C (1,112 to 1,562 °F). This means that a lot of carbon monoxide is formed (which is a flammable gas) which is when there is greatest risk of backdraft. When this occurs, combustible gases at or above the flash point of spontaneous combustion are exposed to oxygen, carbon monoxide and superheated hydrocarbons combust, and temporary temperatures of up to 2,000 °C (3,630 °F) occur.

Common flame temperatures
This is a rough guide to flame temperatures for various common substances (in 20 °C (68 °F) air at 1 atm. pressure):

Highest temperature
Dicyanoacetylene, a compound of carbon and nitrogen with chemical formula C4N2 burns in oxygen with a bright blue-white flame at a temperature of 5,260 K (4,990 °C; 9,010 °F), and at up to 6,000 K (5,730 °C; 10,340 °F) in ozone. This high flame temperature is partially due to the absence of hydrogen in the fuel (dicyanoacetylene is not a hydrocarbon) thus there is no water among the combustion products.
Cyanogen, with the formula (CN)2, produces the second-hottest-known natural flame with a temperature of over 4,525 °C (8,177 °F) when it burns in oxygen.

Cool flames
At temperatures as low as 120 °C (248 °F), fuel-air mixtures can react chemically and produce very weak flames called cool flames. The phenomenon was discovered by Humphry Davy in 1817. The process depends on a fine balance of temperature and concentration of the reacting mixture, and if conditions are right it can initiate without any external ignition source. Cyclical variations in the balance of chemicals, particularly of intermediate products in the reaction, give oscillations in the flame, with a typical temperature variation of about 100 °C (212 °F), or between "cool" and full ignition. Sometimes the variation can lead to an explosion.

In microgravity
In the year 2000, experiments by NASA confirmed that gravity plays an indirect role in flame formation and composition. The common distribution of a flame under normal gravity conditions depends on convection, as soot tends to rise to the top of a flame (such as in a candle in normal gravity conditions), making it yellow. In microgravity or zero gravity environment, such as in orbit, natural convection no longer occurs and the flame becomes spherical, with a tendency to become bluer and more efficient. There are several possible explanations for this difference, of which the most likely is the hypothesis that the temperature is sufficiently evenly distributed that soot is not formed and complete combustion occurs. Experiments by NASA reveal that diffusion flames in microgravity allow more soot to be completely oxidized after they are produced than do diffusion flames on Earth, because of a series of mechanisms that behave differently in microgravity when compared to normal gravity conditions. These discoveries have potential applications in applied science and private industry, especially concerning fuel efficiency.

Thermonuclear flames
Flames do not need to be driven only by chemical energy release. In stars, subsonic burning fronts driven by burning light nuclei (like carbon or helium) to heavy nuclei (up to iron group) propagate as flames. This is important in some models of Type Ia supernovae. In thermonuclear flames, thermal conduction dominates over species diffusion, so the flame speed and thickness is determined by the thermonuclear energy release and thermal conductivity (often in the form of degenerate electrons).

See also
Flame detector
International Flame Research Foundation
Oxidizing and reducing flames
The Combustion Institute

References
External links
A candle flame strongly influenced and moved about by an electric field due to the flame having ions. (archived 30 September 2011)
Ultra-Low Emissions Low-Swirl Burner Archived 13 June 2017 at the Wayback Machine
7 Shades of Fire (archived 31 August 2017)
Licence, Peter. "Coloured Flames". The Periodic Table of Videos. University of Nottingham.