While a deus ex machina may save your character's life, it'll often kill your script.
There is no right or wrong way to write a screenplay—but there are some seriously lazy tropes that you may be unintentionally employing in your narrative. One of these is a plot device called deus ex machina. Even if you've never heard the term before, you've definitely seen it a thousand times and unless the move is self-aware and/or for laughs, it pretty much never leaves the audience satisfied.
In this video essay, Fandor's Jacob T. Swinney dives into the concept of deus ex machina, what it is and how it different filmmakers have used it (sometimes successfully but mostly unsuccessfully) in their films. Check it out below:
What is deus ex machina
"Deus ex machina" is a Latin term that means "god from the machine," a phrase borrowed from the Greek "pò mēkhanês theós." Originally, it was a convention of Greek tragedies in which actors playing gods were literally lowered onto the stage using a crane or lifted from a trapdoor using a riser. Today, the term refers to a plot device that offers a contrived, unexpected solution to a character's inescapable problem. Examples of this include the T-Rex randomly showing up to fight off the raptors at the end of Jurassic Park, Dorothy killing the Wicked Witch by unintentionally dumping water on her in The Wizard of Oz, and the Hulk popping up in the nick of time to save the day in The Avengers.
Why it doesn't work
We've all written ourselves into a corner, leaving our characters with nowhere to go and nothing to do other than accept their certain death or failure. However, the solution to this is not to have some unknown and unintroduced force randomly show up at precisely the right moment to bail them out, especially when it's never mentioned in the plot prior to its appearance. To audiences, this seems cheap and lazy, and it doesn't leave them with the much-desired feeling of closure, but rather a whole new batch of unanswered questions.
(Rare) occasions in which it works
Now, that doesn't mean that a deus ex machina never works. Several films, like Shawn of the Dead, Monty Python's Life of Brian, and Adaptation, use this trope successfully, but only because it's either used in a comedic way or because the film itself is self-aware about employing it. (I would argue, however, that the deus ex machina in Adaptation, the crocodile that kills Laroche, is more of a Chekhov's Gun than a bonafide deus ex machina.)
What you should do instead
I don't want you to get the wrong idea about all this. It's okay to have giant eagles swoop in, White Wizard in tow, to save the day, but you have to give your audience at least a little information about them ahead of time. In other words, your audience shouldn't be wondering where the hell your final act saviors came from, they should be remembering the scene that occurred previously that foreshadowed their arrival. An effective mechanism for foreshadowing is Chekhov's Gun, a character or device that seems to have a minor role that suddenly becomes important to the story, like Ripley's ability to use the power loader in Aliens— it seems unimportant at first, but, in the end, it's the thing that allows her to defeat the Exomorph Queen.
What's your favorite (or least favorite) example of deus ex machina in film? Let us know down in the comments.