As I see it there are two
right ways to incorporate magic into a setting, be it a book, movie or cRPG game.
According to the teachings of the first school magic is the incomprehensible, mysterious, mesmerizing, dangerous, treacherous and unknown. It is embodiment of all that we humans experience, sometimes even on a daily basis but find it hard to label. Feelings, strange premonitions, different sensations, dreams and everything other which is embeded into human psyche but cannot be called by name lest the word deprives it of original meaning.
In this view magic surrounds every human activity, shapes it, influences human outlook on life even to the point when it starts constituting the basis of morality and even law for the given community. Yes, it is very strongly connected with religion sometimes becoming synonymus to religious spirituality.
A mage in this interpretation assumes two roles - someone exceptional blessed by the spirits with extraordinary abilities and / or someone who simply possesses vast knowledge about spiritual matters - ancient rites, codes of conduct towards supernatural beings (be it gods, fairies, devils, ghost etc). These roles are not necessarily exclussive though may be. As a matter of fact it appears that it was common belief from ancient times till Age of Reason (and even much much later!) that anyone can perform an act of magic or rather cause it to be performed, even ignorantly. If such a thing happened, whether it was human's fault or not it wizard's / shaman's / priest's / inquisitor's / buddhist monk's / seer's job to deal with the consequences and pacify / banish supernatural powers.
This approach is, in my view extremely difficult to present convincingly - the (script)writer must really know his trade well in order to allow for perfect suspension of disbelief in audience. Though rare there are some cases of this kind of magick being realised superbly well in various media. Silent Hill and Fatal Frame series strike me as perfect specimen of this genre in gaming. The Void / Tension / Turgor also fits right there. In books and comicbooks, pretty much everything written by Gaiman comes to my mind.
Another 'correct' way to show magic is presenting it simply as natural, 'scientific' phenomena. This is especially popular in all kinds of sci-fi settings. Ther magic becomes 'psionics', 'bionics' or 'psychocinesics' - a talent, often dormant which is brought out by some sort of device, implant, genetic modification etc. In fantasy setting such methods are frequently unnecessary - grueling training is enough.
'Scientific' magic is different from the previous sort in that everything in it is clear and understandable. If not to the audience, or the other characters than at the very least to the mage himself. The reader may not know how the wizard managed to cast the fireball - for obvious reasons - but it will be somehow implied that there was science somewhere in it. Perhaps that fireball was created through psychokinetic manipulation on molecule level which caused the masses of air to heat up and ignite themselves. Maybe that rock is hovering because it is being pushed by the masses of the same air the mage with his psychic powers. Or it contained large quantities of iron which allowed for it being temporarily magnetised and pulled away from the other stone with the same charge. Though far-fetched (especially coming from me
) these explanations often suffice for suspension of disbelief.
Examples of this type of magic employed in media include: System Shock series, X-Com, Battle Star Galactica, Large portion of Raimond E. Feist 'Riftwar Saga', and surprise, surpise second half of Pratchett's 'Discworld' series.
There is also the third 'right' way which is, let's face it predominant in all kinds of sci-fi media. Mix of both of the abovementioned styles. It will always vary in degrees. There are plenty of examples out there. Pick one. My two favourite are: 'Planescape: Torment' - with its constant clash between 'scientific' and 'supernatural' approach to magic (inclines towards supernatural much more) and A. Sapkowski's 'Hussites Saga' - magic in medical treatment, assassination, espionage, and as a viable 'scientific' method in pursuit of the knowledge about the world contrasted with seemingly primitive but all the same bafflingly powerful and ellusive practices of a - say - village witch (inclines towards scientific interpretation by very small margin).
One treatment on magic I simply cannot stand, and which is becoming sadly predominant in every recent fantasy production I've seen recently is when it becomes a tool with no justification in the setting. Magic sits out there only to explain all the 'kewl' shit occuring on your screen. As a result you mage can assplode volcanoes into existence, bombard enemies with commets, nuke them with fireballs without anyone giving a shit what consequences of these actions - for simple reason - there are none. Initially jRPGs were at fault but now to my mind MMORPGs are to blame. Hence, instead of a Mage, Shaman, or Priest we get 'Mobile artillery platform', 'buffer', and 'healer' - these characters are no longer spell casters - they become tropes. You cannot harm magic more in any sci-fi / fantasy setting than by reducing it to "click - fireball, - click - protection spell, click - healing spell, click - mana potion, click - fireball" rinse and repeat.