Deus ex machina (Latin: ['de?s ?ks 'ma:.k.na:]: or ; plural: dei ex machina) is a plot device whereby a seemingly unsolvable problem in a story is suddenly and abruptly resolved by an unexpected and seemingly unlikely occurrence, typically so much as to seem contrived. Its function can be to resolve an otherwise irresolvable plot situation, to surprise the audience, to bring the tale to a happy ending, or act as a comedic device.
The term was coined from the conventions of Greek tragedy, where a machine is used to bring actors playing gods onto the stage. The machine could be either a crane (mechane) used to lower actors from above or a riser that brought actors up through a trapdoor. Preparation to pick up the actors was done behind the skene. The idea was introduced by Aeschylus and was used often to resolve the conflict and conclude the drama. Although the device is associated mostly with Greek tragedy, it also appeared in comedies.
Aeschylus used the device in his Eumenides, but it was with Euripides that it became an established stage machine. More than half of Euripides' extant tragedies employ a deus ex machina in their resolution, and some critics claim that Euripides, not Aeschylus, invented it. A frequently cited example is Euripides' Medea, in which the deus ex machina, a dragon-drawn chariot sent by the sun god, is used to convey his granddaughter Medea, who has just committed murder and infanticide, away from her husband Jason to the safety and civilization of Athens. In Alcestis, the eponymous heroine agrees to give up her own life in order to spare the life of her husband, Admetus. At the end, Heracles shows up and seizes Alcestis from Death, restoring her to life and to Admetus.
The effect of the device on Greek audiences was a direct and immediate emotional response. Audiences would have a feeling of wonder and astonishment at the appearance of the gods, which would often add to the moral effect of the drama.
Shakespeare used the device in As You Like It, Pericles, Prince of Tyre, Cymbeline and The Winter's Tale. It was also used in John Gay's The Beggar's Opera where the author uses a character to break the action and rewrite the ending as a reprieve of the hanging of MacHeath. Both in Shakespeare's and Gay's plays the deus ex machina happens with breaking the dramatic illusion often in the form of an episodic narrator exposing the play itself and laying bare the author. This is different from the use of the deus ex machina in the ancient examples with the ending coming from a participant in the action in the form of a god. It is natural for the gods to be considered participants and not outside sources because of their privileged position and power. It is these attributes that allow the Greek gods to believably wrap up and solve the series of events.
During the politically turbulent 17th and 18th centuries, the deus ex machina was sometimes used to make a controversial thesis more palatable to the powers of the day. For example, in the final scene of Molière's Tartuffe the heroes are saved from a terrible fate by an agent of the compassionate, all-seeing king -- the same king that held Molière's career and livelihood in his hands.
Aristotle was the first to use a Greek term equivalent to the Latin phrase deus ex machina as a term to describe the technique as a device to resolve the plot of tragedies. It is generally deemed undesirable in writing and often implies a lack of creativity on the part of the author. The reasons for this are that it does not pay due regard to the story's internal logic (although it is sometimes deliberately used to do this) and is often so unlikely that it challenges suspension of disbelief, allowing the author to conclude the story with an unlikely, though perhaps more palatable, ending.
In the novel Lord of the Flies, the rescue of the savage children by a passing navy officer (which author William Golding called a "gimmick") is viewed by some critics as a deus ex machina. The abrupt ending conveys the terrible fate that would have afflicted the children (in particular Ralph) if the officer had not arrived at that moment.
J. R. R. Tolkien referred to the Great Eagles that appear in several places in The Hobbit and The Lord of the Rings as "a dangerous 'machine'.". This was in a letter refusing permission to a film adapter to have the Fellowship of the Ring transported by eagles rather than traveling on foot. He felt that the eagles had already been overused as a plot device. For example, in The Hobbit, the eagles save Bilbo Baggins, Gandalf, and the dwarves from the goblins and wolves, then help turn the tide of the Battle of the Five Armies, and in The Return of the King they save Frodo and Sam from certain death on Mount Doom. In the Harvard Lampoon's parody Bored of the Rings, the eagles are referred to as 'Deus ex Machina Airlines.'
Deus ex machina was also used by Charles Dickens in Oliver Twist, when in the very peak of climax, Rose Maylie turns out to be the long-lost sister of Agnes, and therefore Oliver's aunt; and she marries her long-time sweetheart Harry, allowing Oliver to live happily with his saviour, Mr. Brownlow.
The deus ex machina device has many criticisms attached to it, mainly referring to it as inartistic, too convenient, and overly simplistic. On the other hand, champions of the device say that it opens up ideological and artistic possibilities.
Antiphanes was one of the device's earliest critics. Antiphanes believed that the use of the deus ex machina was a sign that the playwright was unable to properly manage the complications of his plot.
when they don't know what to say
and have completely given up on the play
just like a finger they lift the machine
and the spectators are satisfied.
In the characters too, exactly as in the structure of the incidents, [the poet] ought always to seek what is either necessary or probable, so that it is either necessary or probable that a person of such-and-such a sort say or do things of the same sort, and it is either necessary or probable that this [incident] happen after that one. It is obvious that the solutions of plots too should come about as a result of the plot itself, and not from a contrivance, as in the Medea and in the passage about sailing home in the Iliad. A contrivance must be used for matters outside the drama -- either previous events which are beyond human knowledge, or later ones that need to be foretold or announced. For we grant that the gods can see everything. There should be nothing improbable in the incidents; otherwise, it should be outside the tragedy, e.g., that in Sophocles' Oedipus.-- Poetics, (1454a33-1454b9)
Aristotle praised Euripides, however, for generally ending his plays with bad fortune, which he viewed as correct in tragedy, and somewhat excused the intervention of a deity by suggesting that "astonishment" should be sought in tragic drama:
Irrationalities should be referred to what people say: That is one solution, and also sometimes that it is not irrational, since it is probable that improbable things will happen.
Such a device was referred to by Horace in his Ars Poetica (lines 191-2), where he instructs poets that they should never resort to a "god from the machine" to resolve their plots "unless a difficulty worthy of a god's unraveling should happen" [nec deus intersit, nisi dignus uindice nodus inciderit; nec quarta loqui persona laboret].
Following Aristotle, Renaissance critics continued to view the deus ex machina as an inept plot device, although it continued to be employed by Renaissance dramatists.
Towards the end of the 19th century, Friedrich Nietzsche criticized Euripides for making tragedy an optimistic genre via use of the device, and was highly skeptical of the "Greek cheerfulness", prompting what he viewed as the plays' "blissful delight in life". The deus ex machina as Nietzsche saw it was symptomatic of Socratic culture, which valued knowledge over Dionysiac music and ultimately caused the death of tragedy:
But the new non-Dionysiac spirit is most clearly apparent in the endings of the new dramas. At the end of the old tragedies there was a sense of metaphysical conciliation without which it is impossible to imagine our taking delight in tragedy; perhaps the conciliatory tones from another world echo most purely in Oedipus at Colonus. Now, once tragedy had lost the genius of music, tragedy in the strictest sense was dead: for where was that metaphysical consolation now to be found? Hence an earthly resolution for tragic dissonance was sought; the hero, having been adequately tormented by fate, won his well-earned reward in a stately marriage and tokens of divine honour. The hero had become a gladiator, granted freedom once he had been satisfactorily flayed and scarred. Metaphysical consolation had been ousted by the deus ex machina.-- Friedrich Nietzsche
Nietzsche argued that the deus ex machina creates a false sense of consolation that ought not to be sought in phenomena. His denigration of the plot device has prevailed in critical opinion.
In Arthur Woollgar Verrall's publication Euripides the Rationalist (1895), he surveyed and recorded other late 19th century responses to the device. He recorded that some of the critical responses to the term referred to it as 'burlesque', 'coup de théâtre', and 'catastrophe'. Verrall notes that critics have a dismissive response to authors who deploy the device in their writings. He comes to the conclusion that critics feel that the deus ex machina is evidence of the author's attempt to ruin the whole of his work and prevent anyone from putting any importance on his work.
However, other scholars have looked at Euripides' use of deus ex machina and described its use as an integral part of the plot designed for a specific purpose. Often Euripides' plays would begin with gods, so it is argued that it would be natural for the gods to finish the action. The conflict throughout Euripides' plays would be caused by the meddling of the gods and therefore would make sense to both the playwright and the audience of the time that the gods would resolve all conflict that they began. Half of Euripides' eighteen extant plays end with the use of deus ex machina, therefore it was not simply a device to relieve the playwright of the embarrassment of a confusing plot ending. This device enabled him to bring about a natural and more dignified dramatic and tragic ending.
Other champions of the device believe that it can be a spectacular agent of subversion. It can be used to undercut generic conventions and challenge cultural assumptions and the privileged role of tragedy as a literary/theatrical model.
Some 20th-century revisionist criticism suggests that deus ex machina cannot be viewed in these simplified terms, and contends that the device allows mortals to "probe" their relationship with the divine.Rush Rehm in particular cites examples of Greek tragedy in which the deus ex machina complicates the lives and attitudes of characters confronted by the deity, while simultaneously bringing the drama home to its audience. Sometimes, the unlikeliness of the deus ex machina plot device is employed deliberately. For example, comic effect is created in a scene in Monty Python's Life of Brian when Brian, who lives in Judea at the time of Christ, is saved from a high fall by a passing alien space ship.