Organic, effective, inexpensive: Cider Vinegar.
Fresh produce and warm, humid summer air means fruit flies. Since we've begun composting, I've dreaded them. I read an article that mentioned using cider or red wine vinegar in a small bowl with a dot of dish soap to control flies of all kinds. The sweet vinegar lures the flies even more than fruit sugars and the soap breaks the surface tension, so they land to eat and drown.
I've been keeping a small bowl on the kitchen window sill near the compost bin. I was fairly sure this was helping immensely this summer since we hadn't had a fruit fly problem....but without a problem in the first place it's hard to be sure. Luckily (?) upon returning from vacation, we realized that we'd neglected to take out our kitchen trash. We had hordes of fruit flies in the kitchen. I set out two bowls immediately and, by the next morning, there were almost no fruit flies anywhere. Today is Wednesday and I can say for sure that this is a terrifically effective technique for controlling flies.
Now, each year in the first or second week of August we seem to be inundated with buzzy, slow-moving flies. So slow, in fact, that I can suck them off windows with my Dustbuster. They only seem to be around for a week or two, but they are incredibly annoying (and, honestly, kind of gross). Will Cider Vinegar save the day? Here's to hoping!