Dr. Ken Paige, professor and Associate Head of the Department of Animal Biology at the University of Illinois, Champaign-Urbana, states flies bite before it rains due to the decrease in barometric pressure. As the barometric pressure drops, flies feed instinctively to increase the odds that they survive the upcoming storm.
Insect activity increases in the hot, muggy weather that often precedes a storm. In addition, this type of weather causes humans to perspire more and produce body odors that lure flies and other insects. Gnats and other insects are more active and more likely to bite or sting prior to a storm for similar reasons.