Some types of fly ear be ejecting a saliva-like substance to dissolve their food. Why it would be doing it on a window is another matter.
Sent from my iPhone using Tapatalk
Sucking it back in is how they eat. What's weird is doing it when there is apparently no food. My guess is that that particular fly was not long for this world. My understanding--keep in mind that I'm no expert--is that common species of house flies have a life span of 20-30 days, from newly laid egg to death.