What is it that creates that wonderful smell after a fresh rain?
That molecule is called Geosmin. It is mainly produced 1 by Actinomycetes such as Streptomyces which are filamentous bacteria that live in soil. Other organisms also produce geosmin:


Cyanobacteria
Certain fungi
An amoeba called Vanella
A liverwort


It is an intracellular metabolite and cell damage is the primary reason attributed to its release. However oxidant exposure and transmembrane pressure also causes geosmin release in cyanobacteria. It seems that the release is triggered by some kind of stress. 

I am not quite sure about their advantage to the host species.


1 or perhaps the most well-studied in