The best approach I've seen is that magic can be either exploited or explained, but not both.

Suppose you can generate fireballs at will. Your scientist friend comes up with a lot of ways to examine and analyze what's happening. Finally he discovers that all along it was just spontaneous explosions of swamp gas, a complete coincidence. Now you can't generate fireballs at will anymore. Thanks, scientist friend.