Origin and occurrence of fluorine

Fluorine is relatively rare in the universe compared to other elements of nearby atomic weight. On earth, fluorine is essentially found only in mineral compounds because of its reactivity. The main commercial source, fluorite, is a common mineral.
In the universe.
At 400 ppb, fluorine is estimated to be the 24th most common element in the universe. It is comparably rare for a light element (elements tend to be more common the lighter they are). All of the elements from atomic number 6 (carbon) to atomic number 14 (silicon) are hundreds or thousands of times more common than fluorine except for 11 (sodium). One science writer described fluorine as a "shack amongst mansions" in terms of abundance. Fluorine is so rare because it is not a product of the usual nuclear fusion processes in stars. And any created fluorine within stars is rapidly eliminated through strong nuclear fusion reactions—either with hydrogen to form oxygen and helium, or with helium to make neon and hydrogen. The presence of fluorine at all—outside of temporary existence in stars—is somewhat of a mystery because of the need to escape these fluorine-destroying reactions.
Three theoretical solutions to the mystery exist: In type II supernovae, atoms of neon could be hit by neutrinos during the explosion and converted to fluorine. In Wolf-Rayet stars (blue stars over 40 times heavier than the Sun), a strong solar wind could blow the fluorine out of the star before hydrogen or helium could destroy it. Finally, in asymptotic giant branch (a type of red giant) stars, fusion reactions occur in pulses and convection could lift fluorine out of the inner star. Only the red giant hypothesis has supporting evidence from observations.
In space, fluorine commonly combines with hydrogen to form hydrogen fluoride. (This compound has been suggested as a tracer to enable tracking reservoirs of hydrogen in the universe.) In addition to HF, monatomic fluorine has been observed in the interstellar medium. Fluorine cations have been seen in planetary nebulae and in stars, including our Sun.
On Earth.
Fluorine is the thirteenth most common element in Earth's crust, comprising between 600 and 700 ppm of the crust by mass. Because of its reactivity, it is essentially only found in compounds.
Commercial sources.
Three minerals exist that are industrially relevant sources of fluorine: fluorite, fluorapatite, and cryolite.
Fluorite.
Fluorite (CaF2), also called fluorspar, is the main source of commercial fluorine. Fluorite is a colorful mineral associated with hydrothermal deposits. It is common and found worldwide. China supplies more than half of the world's demand and Mexico is the second-largest producer in the world
The United States produced most of the world's fluorite in the early 20th century, but its last mine, in Illinois, shut down in 1995. Canada also exited production in the 1990s. The United Kingdom has declining fluorite mining and has been a net importer since the 1980s.
Fluorapatite.
Fluorapatite (Ca5(PO4)3F) is mined along with other apatites for its phosphate content and is used mostly for production of fertilizers. Most of the Earth's fluorine is bound in this mineral, but because the percentage within the mineral is low (3.5%), the fluorine is discarded as waste. Only in the United States is there significant recovery. There, the hexafluorosilicates produced as byproducts are used to supply water fluoridation.
Cryolite.
Cryolite (Na3AlF6) is the least abundant of the three major fluorine-containing minerals, but is a concentrated source of fluorine. It was formerly used directly in aluminium production. However, the main commercial mine, on the west coast of Greenland, closed in 1987.
Minor occurrences.
Several other minerals, such as the gemstone topaz, contain fluoride. Fluoride is not significant in seawater or brines, unlike the other halides, because the alkaline earth fluorides precipitate out of water. Commercially insignificant quantities of organofluorines have been observed in volcanic eruptions and in geothermal springs. Their ultimate origin (from biological sources or geological formation) is unclear.
The possibility of small amounts of gaseous fluorine within crystals has been debated for many years. One form of fluorite, antozonite, has a smell suggestive of fluorine when crushed. The mineral also has a dark black color, perhaps from free calcium (not bonded to fluoride). In 2012, a study reported detection of trace quantities (0.04% by weight) of diatomic fluorine in antozonite. It was suggested that radiation from small amounts of uranium within the crystals had caused the free fluorine defects.