Flies can be treated with general household sprays; however, it is the nearby hatching of fly larvae that could well be the root of the problem.
Larval Stage of Winged Insects
Maggots are the larvae of winged insects, especially houseflies and blowflies.
They are hatched from eggs which are usually laid on rotting meat or faeces. They have a putrid odor and disgust most people.