Why do flies fly around ceiling lights?

They seems to go in squares, for no purpose at all -the light doesn't even have to be on. And it's never the big flies, either, just the smaller ones.
Update: Actually, I'm more interested why they do it when the light s off; the light being on acting as a beacon I can understand. But they don't fly around other objects in the room -just the light fitting.
20 answers 20