Image copyright Thinkstock

Fluorine is an evil gas. And it is also used to manufacture a string of other artificial gases, some of which nearly left mankind exposed to burning ultraviolet light - and are even now warming the planet.

"Fluorine is the tyrannosaurus rex of the periodic table," says chemistry professor Andrea Sella. "It will react spontaneously with every other element except for helium, neon and argon."

If you ever happen to lay eyes on pure, elemental fluorine, it looks fairly innocuous - a pale yellow gas - but in truth it is so dangerous that Sella's department at University College London does not even keep it in stock.

It produces a smell similar to chlorine, he says, "but generally, if you smell fluorine what you do is run away as fast as you can".

Sella does have a jar of another frightening material - hydrofluoric acid or HF. Its acidity - that is, the reactiveness of the hydrogen ions it contains - is not actually quite as strong as that of the better known hydrochloric or sulphuric acids.

But it is nonetheless an exceptionally vicious chemical, because the ferocious fluorine ions can penetrate deep into your body. "It's an unbelievably painful burn, and one that you cannot really treat, because it's gone inside," says Sella.

Once inside, the fluoride gobbles up the body's calcium, which can lead to heart failure in extreme cases.

HF's corrosiveness does have its uses, such as etching glass or microchip circuitry. Yet this noxious acid is mainly used to produce an array of other chemicals that have one surprising thing in common - they are exceptionally un-reactive.

"The result of this extreme reactivity of the element fluorine itself means that its compounds are staggeringly stable," explains Sella. "Molecules surrounded by fluorine are like a tortoise surrounded by a carapace that you cannot break through."

Consider Teflon, which comprises long chains of carbon atoms surrounded by fluorine. The carbon-fluorine bond is particularly strong and chemically impenetrable, making this plastic the perfect inert substance for non-stick pans.

Image copyright Thinkstock

Then there's toothpaste. It contains tiny amounts of those aggressive fluoride ions. But once in your mouth, the ions combine with calcium in your teeth to provide a protective coating of chemically resilient calcium fluoride.

Image copyright Thinkstock

And then there are the gases - the "F-gases", as they are known.

The most notorious are the chlorofluorocarbons, or CFCs - bundles of fluorine, carbon and chlorine - which were found in the 1980s to be destroying the ozone layer.

CFC molecules are sufficiently robust to reach the upper atmosphere intact. Once there, powerful ultraviolet light from the sun breaks them up, releasing the chlorine, which then sets about tearing apart the neighbouring ozone.

As ozone filters out the most harmful wavelengths of the sun's UV, this was a problem. Had the release of CFCs continued unchecked, the amount of UV reaching the surface of the earth would eventually have increased up to 100-fold, causing extreme sunburn and skin cancer.

CFCs first came to be mass-produced because they were identified as a perfect refrigerant - a fluid that switches easily from gas to liquid and back again, absorbing and releasing large amounts of heat as it does so.

As such they could be circulated through a refrigerator or air conditioner to transfer the heat out. Their rapid ability to vaporise also made them handy propellants in aerosol sprays.

Their inventor was the strangely tragic American chemist Thomas Midgley Jr - the same man who put the lead into petrol.

But while Midgley almost literally washed his hands of lead's poisonousness, his role in CFCs is far less reprehensible, according to Ian Shankland, who leads modern-day efforts to develop refrigerants at US chemicals giant Honeywell.

Thomas Midgley 1889-1944

Image copyright Science Photo Library

American chemist who put lead into petrol

Spent months plagued by the effects of lead poisoning after pouring the chemical on to his hands and breathing the vapour to prove it was safe

Also discovered a chlorofluorocarbon (marketed as Freon-12) could be used as a refrigerant

Contracted polio in 1940, and invented a hoist mechanism to help him get in and out of bed - he later became caught in it and asphyxiated

"Go back to the 1920s," he says. "Refrigerants were flammable like hydrocarbons, toxic like ammonia, or flammable and toxic like methyl chloride. There were accidents and people died."

CFCs by contrast were seemingly inert, so Midgley had every reason to think he had produced a "safe" alternative - one that led to the proliferation of air conditioning in homes, offices and cars.

It would be decades before the danger posed by CFCs was discovered. But the world reacted swiftly with one of the first global environmental treaties, the 1987 Montreal Protocol. And it has worked. Evidence last year suggested the ozone layer may finally have stabilised - a quarter of a century after the phase-out of CFCs began.

But there the good news ends, because we are still living with another legacy of CFCs - they are also powerful greenhouse gases, many times stronger than carbon dioxide. Even today they still account for a staggering 14% of the total manmade global warming effect.

And an additional problem is that the very same chemical stability that makes CFCs such seemingly safe refrigerants, also means they take a long time to decompose in the atmosphere. (The ozone layer was being destroyed by the relatively small proportion of molecules that reached the upper atmosphere, and became exposed to the strongest UV light.)

"Their strength comes from the fact that the carbon-fluorine bond is the strongest single bond between atoms in organic molecules," explains Honeywell's Ian Shankland. "That same carbon-fluorine bond absorbs in the infrared wavelength and therefore CFCs are very potent greenhouse gases."

As a result, the banning of CFCs - in fridges, and aerosols and everywhere else - inadvertently also had "the biggest impact so far on mitigating climate change" according to Stefan Reimann, who monitors emissions of fluorinated gases for the World Meteorological Society.

But there are still plenty of other "F-gas" emissions. The use of fluorspar (calcium fluorite) in aluminium smelting, for example - as a "flux agent" to lower the temperature needed to extract the metal from the ore - results in emissions of tetrafluoromethane (CF4, also known as carbon tetrafluoride).

F-gases Gas Use Lifetime in atmosphere (half-life) Global warming potential CFC-11 Early refrigerant (banned) 45 years 4,660x CO2 CFC-12 Car air conditioning (banned) 100 years 10,200x CFC-113 Refrigerant, propellant (banned) 85 years 5,820x HCFC-22 Refrigerant, propellant 12 years 1,760x HFC-23 Microchip etching, fire suppressant, by-product of HCFC-22 production 222 years 12,400x HFC-134a Fridges, car air conditioning 13 years 1,300x HFO-1234yf Replacement for HFC-134a 11 days <1x Tetrafluoromethane (CF4) By-product of aluminium smelting 50,000 years 6,630x Hexafluoroethane (C2F6) By-product of aluminium smelting 10,000 years 11,100x Nitrogen trifluoride (NF3) Etching silicon 500 years 16,100x Sulphur hexafluoride (SF6) Anti-sparking in electricity substations, magnesium production 3,200 years 23,500x Source: IPCCC

Its molecules contain four of those ultra-stable fluorine-carbon bonds, meaning it lasts for tens of thousands of years in the atmosphere - and it is over 6,000 times more potent than CO2 as a greenhouse gas.

Then there's nitrogen tri-fluoride, which lasts for centuries and is 16,000 times more powerful than CO2 as a greenhouse gas. This is often emitted in the process of etching silicon - including, ironically, the silicon used in the manufacture of some supposedly environmentally friendly solar panels.

The worst offender is sulphur hexafluoride - a gas used to stop dangerous electrical sparking or arcing in electricity substations. It is a greenhouse gas 23,000 times more powerful than CO2.

According to Stefan Reimann, these new F-gases, mostly released since the Montreal Protocol came into force in 1989, contribute a mere 1-2% of the greenhouse effect, but this is expected to rise to 20% by mid-century, as billions of Chinese, Indians and Africans start using air conditioning - particularly in their cars.

Instead of CFCs, most modern air con uses another non-flammable refrigerant called hydrofluorocarbons, or HFCs - chemicals pioneered by Ian Shankland's team at Honeywell in the 1980s and 90s.

They removed the ozone-killing chlorine in CFCs, and substituted hydrogen, which, Shankland says, provides a mechanism for the molecule to degrade more quickly in the atmosphere. HFCs decay over decades instead of centuries. But they are still 1,000 times more powerful as greenhouse gases than CO2. And this is a particular problem in car air conditioning - the vibrations from driving mean that about 10% of the HFC refrigerant leaks out each year.

So the EU responded by banning HFCs starting with new models in 2013, and new cars of any model from 2017 onwards. The eager researchers in Ian Shankland's Honeywell team already have a successor - hydrofluoro-olefins, or HFOs. "We included a double bond in the molecules," says Shankland, "so it reacts very quickly in the atmosphere, with a half-life of weeks."

But even though their short lives mean they pose a negligible risk to our climate, the latest refrigerants are still causing controversy - and a big headache for Honeywell and rivals Dupont, who collaborated in developing them.

It all began in 2012, when the German carmaker Daimler claimed that one of its Mercedes containing the new HFO refrigerant became a ball of fire during tests, leaving them "frozen with shock". It was later claimed the flames produced HF vapour and another chemical allegedly analogous to phosgene, a poison gas used in World War One.

The German government then unilaterally postponed the 2013 phase-out of the old refrigerants in new car models, giving Daimler and also Volkswagen time to work on an alternative CO2-based air conditioner.

Bitter accusations flew back-and-forth across the Atlantic, with Honeywell accusing Daimler of having engineered the test to produce that outcome.

All other tests carried out on the HFO, including by Germany's own Federal Motor Transport Authority, have found it to be safe.

Certainly car manufacturers have every incentive to look for an alternative - the new HFO product is 10 times the price of its predecessor. And it is the question of price that now appears to be the real bone of contention. While the EU has deemed HFOs to be safe, it has opened an antitrust investigation into whether Honeywell and Dupont fixed the price of what is the only refrigerant to meet the new EU rules.

Whatever the outcome of this investigation, HFOs have already been installed in millions of new cars. None of them, as yet, has spontaneously burst into flames. Nor are they emitting powerful greenhouse gases. Or at least their air conditioners aren't.

How fluorine got its name

Image copyright Science Photo Library

Fluorine is mined as calcium fluorite, known as "fluorspar" or "fluorite"

Mined in Derbyshire, in the English Peak District, since the 19th Century

Originally used as a "flux" agent in the steelmaking industry in nearby Sheffield, the world's first steel town - adding it lowered the steel's melting point

This is how fluorine got its name - "flux" and "fluorine" are from the Latin word meaning "to flow"

Some of the ores mined in the area were found to light up under ultraviolet light, an effect dubbed "fluorescence" (in fact this is caused by impurities - pure fluorite does not fluoresce)

Correction 9 June 2015: An earlier version of this story incorrectly stated that the German government had successfully lobbied the EU to delay the phasing out of HFCs.

Subscribe to the BBC News Magazine's email newsletter to get articles sent to your inbox.