A bubble-blowing fly sits still as if preoccupied. It exudes a drop of liquid from the mouth and then sucks it back in. Then it does it again, and again, and again. The bubbles range from clear to opaque, but usually one fly in a single sitting makes just one kind. Various species of flies do this, as well as bees, wasps, and lacewings.
Why? It is not clearly understood and there have been lots of suggestions including cooling by evaporation, heating by solar gain, being sick, scaring away attackers, cleaning their mouthparts, and aerating or concentrating liquid food.
Scientists have investigated bubble-blowing in apple maggot flies. In experiments, flies were given dissolved food in various concentrations. After eating dilute food the flies broke off to sit quietly and "bubble." Then they returned to feeding. And then they stopped to bubble some more. The scientists suggested that bubbling was a way for flies engorged with dilute food to eliminate some water through evaporation, allowing them to go back and eat more. But even when you know what they are doing, it's still pretty weird.
God in his wisdom made the fly
And then forgot to tell us why
-- The Fly by Ogden Nash