That's because when they take off they jump backwards. I use a grabbing motion coming up from behind the fly. My hand being 2 or 3 inches above the surface. The fly jump up to take off and quite often ends up in my fist. Trying to squish them can be tricky so a lot of time I just throw them at a hard surface to stun them and then finish them off afterwards.
The very best method to kill flies I have found is with a spray bottle of some kind of glass and surface cleaner. Something like Windex will work, or something stronger with chlorine/bleach will kill them faster. It's better to use the kind of bottle that lets you adjust the output from spray to stream. Stream is more effective but the mist will work if you get close enough. Give it a few practice squirts and you can easily refine your aim (if you ever do any target practice, this will be trivial). Nail 'em with a single squirt and they drop, crawl around a bit, and die. A single shot and they don't get back up. A follow-up shot makes them die faster, though I can't help think that this must be a very nasty and unpleasant fluid in which to drown.
It's much easier than trying to squash them with your hand and less unsanitary too, though definitely less sporting.