Different compounds are involved to varying degrees in the smell of rain, depending on whether we’re talking about the post-rain or the pre-rain smell. The three major origins of these compounds are bacteria in the ground and soil, oils released by plants during periods of dry weather, and electrical charge in the vicinity of thunderstorms.