There is one, central literary application of the deus ex machina and that is to find a sudden and inexplicable solution to a problem or situation. The term literally means “God out of the machine” and is the equivalent of pulling a rabbit out of a hat. It is a well-known and much derided literary technique that is generally seen as a sign of poor writing and plotting. The term is also called a “cop out.” Whether a literary device is deus ex machina or not is quite often open to interpretation.
The literary deus ex machina comes in a number of forms. Some of these are total hat rabbits, but others show signs of an author conscious of the trick and trying to re-plot the story to hide the fact. A total deus ex machina does not try to hide the fact and has a solution that is not hinted at in the previous x-number of words of the story. An illogical one has an element previously mentioned in the story turn up at the right moment to solve said problem.
A pseudo-Chekhov will have instances earlier in the story that back up the solution to the problem or situation. Russian writer Anton Chekhov stated that if an item, such as gun on a wall, is described, then it must be used later in the story. The pseudo-Chekhov is an item that will appear logical because it has been previously described, but still feel improbable to the reader. There will also be times when a carefully plotted explanation to the situation will appear to be a deus ex machina, when it really is not.
The most obvious application of the deus ex machina literary trick is to deal with a sticky situation. Red Riding Hood is stuck in a house with a scary old wolf. How will she survive? Well, the wood cutter comes in at the last moment and saves the day.
There are a number of instances of the lucky rescue act in literature including H.G. Well’s “War of the Worlds” when the aliens on the brink of victory catch a cold and J.R.R. Tolkien’s “Lord of the Rings,” where the giant eagles arrive in time to whisk Frodo and Sam away from the Mount Doom as it erupts.
It is not just sticky situations that require a deus ex machina in literature. It can also refer to social situations, political maneuverings and other plot lines. The miracle takes the form of an opportunistic death, appearance or birth. In George Elliot’s “The Mill on the Floss,” it just so happens to be a flood.
Another application is the self-conscious in-joke. This is where the author clearly lets the readers know there is going to be a miraculous ending; in fact, quite often, the audience is looking forward to it. In an unsubtle move, many writers, such as Richard Adams in “Watership Down,” even call the title containing the miracle “Deus Ex Machina.” Other purveyors of the joke include Jasper Fforde in “The Well of Lost Plots” and Stephen King in “The Dark Tower.”