I thought it normally gets foggy after the rain stops and skies clear; why does it get foggy when it's still raining?
The fog that forms after rain ends and skies clear is called 'radiation fog'. That's because as skies clear and winds ease, heat from near the ground escapes, or 'radiates' up into the sky. That results in cooling and condensation of water vapor remaining near the wet ground. The fog that forms when rain is still falling is usually called 'frontal fog'. The rain in such cases is falling into cooler air near the ground. That falling rain saturates that cooler air, which results in fog.