Deus ex machina
A deus ex machina (pron.: / / or / /; Latin: "god from the machine" pronounced [ˈdeus eks ˈmaː.kʰi.na]; plural: dei ex machina) is a plot device whereby a seemingly unsolvable problem is suddenly and abruptly resolved, with the contrived and unexpected intervention of some new event, character, ability, or object. Depending on how it's done, it can be intended to move the story forward when the writer has "painted himself into a corner" and sees no other way out, to surprise the audience, to bring a happy ending into the tale, or as a comedic device.
Linguistic considerations 
The Latin phrase deus ex machina comes to English usage from Horace's Ars Poetica, where he instructs poets that they must never resort to a god from the machine to solve their plots. He refers to the conventions of Greek tragedy, where a crane (mechane) was used to lower actors playing gods onto the stage. The machine referred to in the phrase could be either the crane employed in the task, a calque from the Greek "god from the machine" (ἀπὸ μηχανῆς θεός, apò mēkhanḗs theós), or the riser that brought a god up from a trapdoor.
The Greek tragedian Euripides is often criticized for his frequent use of the deus ex machina. More than half of Euripides's extant tragedies employ a deus ex machina in their resolution, and some critics go so far as to claim that Euripides invented it, although Aeschylus employed a similar device in his Eumenides. In Euripides' play 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. A more 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 Aristophanes' play Thesmophoriazusae the playwright parodies Euripides' frequent use of the crane by making Euripides himself a character in the play and bringing him on stage by way of the mekhane.
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.—Aristotle, 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.
A deus ex machina 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. 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; Shakespeare used the device in As You Like It, Pericles, Prince of Tyre, Cymbeline and The Winter's Tale.
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 that 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 argues that the deus ex machina creates a false sense of consolation that ought not to be sought in phenomena and this denigration of the plot device has prevailed in critical opinion.
Some 20th-century revisionist criticism suggests that the deus ex machina cannot be viewed in these simplified terms and argues rather 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 serves to complicate the lives and attitudes of characters confronted by the deity whilst simultaneously bringing the drama home to its audience.
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 play 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.
In The Return of the King in The Lord of the Rings trilogy, the ending where Sam and Frodo, having journeyed across Middle-earth for months to reach Mount Doom, has been criticized for them being suddenly rescued by eagles and taken back to Minas Tirith. This is parodied in Bored of the Rings, where the characters Frito and Spam are rescued by an aircraft from "Deus Ex Machina Airlines."
The classic novel Lord of the Flies uses a deus ex machina in its conclusion when the savage children are rescued by a passing navy officer. The author William Golding uses this technique to convey to the audience the terrible fate which would have afflicted the children (in particular Ralph) if the officer had not arrived at that moment.
In Vladimir Nabokov's 1955 novel, Lolita, Charlotte Haze, Humbert Humbert's recent wife and the mother of Dolores "Lolita" Haze, is killed by a moving car in the street. Humbert, who plotted her death earlier in the novel but failed to achieve it, is relieved to find her killed.
On page 376 of the first edition of Carl Sagan's 1985 sci-fi novel Contact, the main character, radio astronomer Ellie Arroway, brings the expression into her conversation with two religious leaders to criticize their view that the message sent from Vega is actually God's own (or The Devil's) - for them a blatant sign that The Rapture is imminent.
Writer Christopher Hitchens observed that author J.K. Rowling often employs deus ex machina in the Harry Potter series. Hitchens argues that the tactic "has a deplorable effect on both the plot and the dialogue" in that it is created by "The need for Rowling to play catch-up with her many convolutions".
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 in 33AD, is 'rescued' from a high fall by a passing space ship.
In the 1995 film Mighty Aphrodite, two unresolved plot points are resolved when a disabled helicopter drops from the sky and introduces the character Linda to her husband (providing her with true love) who will then believe he fathered Lenny's child (covering up her past). Because the film is presented as a Greek play, complete with an amphitheater and a mask-wearing chorus, this is an intentional allusion and employment of a deus ex machina.
Likewise, a deus ex machina was used as a pivotal plot device in the film Adaptation. When the main character seeks screen-writing advice from a veteran of the film industry, he advises, 'Find an ending, but don't cheat, and don't you dare bring in a deus ex machina.' A deus ex machina is later employed in the film, in the form of an alligator attack that saves the main character's life.
At the end of the 2001 film Donnie Darko, Donnie whispers deus ex machina to the film's antagonist right as a runaway Pontiac Trans Am kills the film's heroine. This instills Donnie with the motivation to abandon his current reality, and to go back in time to save his family and the world, and ultimately to sacrifice himself.
Tim Burton uses this writing method in his 2001 re-creation of Planet of the Apes. At the end of the great battle between the humans and the apes, the humans come to a point of near defeat, when suddenly a bright flash covers the sky and a pod lands. When it opens and there is a chimp in a space suit, all the apes bow down and call the chimp 'Semos' (the name of their ape god).
In The Simpsons episode "Thank God It's Doomsday", Homer asks God to undo the apocalypse, and God replies that he can, and remarks 'Deus ex machina' as he turns back time. The joke was that this divine intervention is indeed a 'deus ex machina' ('deus' meaning 'god' in Latin).
A variant of the 'deus ex machina' can be found in the 2005 series finale of Doctor Who, in which the Earth and (in the longer run) the entire universe in the far future are at risk from a Dalek fleet which has survived the Time War. The protaganist, The Ninth Doctor, is unable to bring himself to halt the Dalek stratagem at the expense of the Earth's mutual destruction. With his extermination seemingly imminent, companion Rose Tyler returns for him having looked into the 'heart' of the TARDIS and absorbed the energies of the time vortex. Using the powers therein, Rose is able to destroy the Dalek fleet and thus negate the threat to creation whilst protecting the Earth from harm. Though the concept of absorption of the powers of the time vortex had been explored two episodes previously, this was the first occasion upon which the powers had been shown successfully used in this way. However, despite being an example of a 'deus ex machina' in some ways, the consequences of the plot device in this instance are not left unaddressed; the incident leads to Rose's near-death and subsequent amnesia, the Doctor's regeneration, and the accidental imposition of immortality upon a third character.
Radio comedy 
Another well known example of deliberately used 'deus ex machina' is the Infinite Improbability Drive in Douglas Adams' The Hitchhiker's Guide to the Galaxy. It is presented as a technology used for travelling faster than light, based on probability concepts in quantum theory. It is the infinite improbability drive that saves Arthur Dent and Ford Prefect from very probable death by asphyxiation in deep space after being thrown out of the Vogon ship; the improbable odds against being rescued being 2276709 to one.
- Random House Dictionary
- Rehm (1992, 72) and Walton (1984, 51).
- Janko (1987, 20)
- Poetics 11.5 Penguin, (1996, 45).
- Dr. L. Kip Wheeler. "Literary Terms and Definitions: D". Retrieved 2008-07-26.
- Rehm, (1992, 70).
- Nietzsche (1993, 85).
- Nietzsche (1993, 84–86).
- Nietzsche (2003, 80).
- Rehm (1992, 71).
- "Tartuff: Novel Guide". 2003. Retrieved November 2, 2011.
- Underwood, John. "Top 10 Deus Ex Machina moments". Best for Film. Retrieved November 2, 2011.
- Bloom, Harold. William Golding's Lord of the flies. Page 67. Google Books. Retrieved November 2, 2011.
- Hitchens, Christopher (August 12, 2007). "Harry Potter And The Deathly Hallows - Books Reviews". New York Times. Retrieved 15 February 2012.
- Evans, Alex. "Fear Itself #5 – Review". Weekly Comic Book Review. August 12, 2011
- James Berardinelli, James. "Review: Life of Brian". Reelviews Movie Reviews. 2003
- "Deus ex machina" Hellenica. Retrieved November 2, 2011.
- Bushnell, Rebecca ed. 2005. A Companion to Tragedy. Malden, MA and Oxford: Blackwell Publishing. ISBN 1-4051-0735-9.
- Heath, Malcolm, trans. 1996. Poetics. By Aristotle. Penguin: London. ISBN 978-0-14-044636-4.
- Janko, Richard, trans. 1987. Poetics with Tractatus Coislinianus, Reconstruction of Poetics II and the Fragments of the On Poets. By Aristotle. Cambridge: Hackett. ISBN 0-87220-033-7.
- Mastronarde, Donald, 1990. Actors on High: The Skene roof, the Crane and the Gods in Attic Drama. Classical Antiquity, Vol 9, October 1990, pp 247–294. University of California.
- Rehm, Rush, 1992. Greek Tragic Theatre. Routledge, London. ISBN 0-415-04831-1.
- Tanner, Michael ed. 2003. The Birth of Tragedy. By Nietzsche, Friedrich. Penguin: London. ISBN 978-0-14-043339-5.
- Taplin, Oliver, 1978. Greek Tragedy in Action. Methuen, London. ISBN 0-416-71700-4.
- Walton, J Michael, trans. 2000. Euripides: Medea. Methuen, London. ISBN 0-413-75280-1.