A pleasant smell after rain is because of a group of filamentous bacteria Actinomycetes (streptomycete) found in the soil. They grow well in soil when the conditions are damp and warm.
What are Geosmins?
The geosmins (compound produced by streptomycetes) are a group of volatile chemical compounds of carbon, oxygen and hydrogen.The geosmins first discovered has the chemical name trans-1, 10-dimethyl-trans-9-decalol; however, other volatile products produced by certain species of Streptomyces may also be responsible for the characteristic smell.
Why there is a peculiar smell after rain?
Streptomycetes, grouped as actinomycetes, are abundant in dry warm soil, a million of them can be detected in a gram of the soil. They release compounds such as geosmin and 2 methyl isoborneol when wetted by rain water after a long dry spell. That is why we get the musty odour only after the first rain of the rainy season. The smell can be felt in newly ploughed lands also.