Having got that out the way, my definition revolves around "magic". If the method of action for the "cool stuff" that the characters can do, that people in the real world cannot, is magic then the story is fantasy. If the method of action is based on technological advances then it's science fiction. So, how to define magic?
"Magic" implies that the universe is sentient - it works for its users by starting with effects and then working its way back to causes. This means that a magic user can say "Give me a fireball" (or whatever cod-latin they use instead) and the magic will deal with all of that molecular excitation necessary to produce a flame effect, and then guide it through some means to its target without the magic user having to worry about the details of how it does so. Whereas in Science Fiction you have to start with the heating things up bit, and then work out how to use it to create a big sphere of plasma contained in force fields that then guide it to its target. This is also how real life works - we start with a tool that can do something (create localised heat) and then use it to convert some handy bread into toast - we don't simply demand toast and then let the magic work out how to create it.
Of course, technology smart enough to be sentient can pretend to be magic (and there are various fictional worlds where the "magic" turns out to be very high level tech*), and there are lots of grey areas (psychic powers were traditionally science fiction, since people believed there was a scientific basis for them, and The Force is somewhere a bit further along the same continuum towards magic). But 99% of the time this rule (Do the characters command "ends" or "means") works perfectly well for differentiating the two genres.
Context being this conversation on genre from earlier today.
*In Harry Potter and the Methods of Rationality Ng bar cbvag Uneel gurbevfrf ba gur fbhepr bs zntvp, naq frrzf gb or jbexvat gbjneqf gur vqrn bs napvrag ybfg NV grpu gung vf pbzznaqrq hfvat bofpher cuenfrf. (http://www.rot13.com/ to unencrypt that.)
Original post on Dreamwidth - there are comments there.