Biography
You know how it works. Want to be a billionaire, Take Over the World, gain infinite power, or just get back at that obnoxious Jerk Jock? Well, mosey on down to those crossroads and Mr. S will guarantee your wildest dreams, if you just sign on the dotted line with your own blood. This trope doesn't even require the Abrahamic Devil; any trickster, demon, or evil deity roughly equivalent to Satan can be used. It reached its current version in the 16th-century legend of Faust selling his soul to Mephistopheles (who technically isn't quite exactly Satan, but still a high-ranking demon). The basic story is far, far older, however, with Sanskrit and Sumerian tales of craftsmen making deals with demons for superlative skill, making this Older Than Dirt.
This trope includes both literal Magically Binding Contracts with a literal devil, and crooked deals between any corrupt exploiter (the Mephistopheles role) and a desperate pawn (the Faust role). The exploiter can be offering anything from some shiny new Applied Phlebotinum to making a high school nerd popular, to saving your life moments before death. Sometimes it has no practical value whatsoever. But whatever the service, whatever the offer, there is always a price. This price can be anything — the Faust's soul, their conscience, their firstborn, their loved ones, their voice, their eternal servitude, or even something that seems completely innocent — but whatever the price, it's something that will render the Faust a lot worse off when it is paid, if not bring them to complete ruin.
Note that actual devils will always follow through with their end, even if their end is a sinister bastardization of the terms. Thus always remember to Read the Fine Print and have an experience in law with you if you try to do this. We never see Mephistopheles simply take the soul and run like an amateur scammer; he gave his word, narrated the fine print, put his name on the dotted line and made the wish come true. As icing on the cake, the Mephistopheles sometimes makes sure or just shows in reality that the gift is, in itself, detrimental to the life of the Faust and others around him in the first place — especially if there's a chance at irony, where lacking their "soul", the element they gave up as payment, ultimately makes the gift worthless. The character who offers the deal is often, though not always, The Corrupter (and not all Corrupters use this as a tactic).
An alternate form is a deal where the Mephistopheles offers the Faust exactly what he wants, if not more, but to get it, he has to undergo an Impossible Task that Mephistopheles obviously does not think the Faust can complete, with the Faust's soul as the penalty if he fails. In such occasions they can escape the Devil's trap. Alternately, the deal truly has no strings attached, as it's a Xanatos Gambit where the Faust's good fortune or success will deliver the soul of another to Mephistopheles. Finally, there's a form of this in the case of villains that make a deal with the devil for supernatural power, which often involves the villain doing something truly heinous for the devil in question in order to earn their favor. Magic gained in this fashion is very often Black Magic by definition.
Whether God or the equivalent would be interested in a soul that someone has gambled is the Elephant in the Living Room.
Deal With The Devil plots can overlap with Idiot Ball, as smart and rational people know to stay well the hell away from deals like these. Some writers try to defend the Faust by turning the deal into a Leonine Contract - either the deal was made when the Faust was in desperate straits or under some kind of duress, or the Mephistopheles made the offer when the victim had no time to think (e.g., offering to save him from the Death Trap in return for something nasty). Others make the contract so long, complex and filled with Latin-esque legal jargon that no one will Read the Fine Print (Sloth is a very undervalued sin). Also expect Exact Words and You Didn't Ask to be employed against the Faust. Don't be surprised if the Devil pulls out a Comically Wordy Contract.
If you should find yourself suckered into a Deal With The Devil, The Power of Love may be your best bet at defeating the infernal contract. Or you can try your luck (literally) with a Jury of the Damned. Some Guile Heroes can make it into a Meaningless Villain Victory. With enough power, a Faustian Rebellion is possible.
Common solutions (which often cause a Wishplosion) are:
Ask the devil for something he can't do (like worship God) or that destroys him, which makes the entire deal pointless.
Make a Logic Bomb, infinite loop, Loophole Abuse, etc. For example, if the devil asks to give him your soul after death, you can wish for immortality. In the case of immortality, however, beware — a truly crafty devil might pull a Jackass Genie on you, either by conveniently forgetting about the "eternal youth" part or by turning you into an undead abomination. It may also turn into a case of Who Wants to Live Forever?, even without the devil's manipulations.
It may be possible to gain enough power through the deal to prevent the devil from forcing you to keep your promise—or just kill him. See Faustian Rebellion.
Use your new power to annoy the underworld so much that your deal gets nullified simply to get rid of you.
Conversely, impress or entertain the devil so much that taking your soul would seem like a waste.
If the contract was written, destroy the physical scroll or other material that the contract was written on. Depending on the material and the devil's magic, this may not be as easy as it sounds, and then there's the problem of actually wresting the contract from the devil in the first place.
If the wish is already wasted, then someone else is required to fight fire with fire by engaging into a new contract and defeating the devil.
In comical versions, if the devil is female — usually some apprentice demon who always fails — of course she will be insanely sexy or cute (according to Evil Is Cool, Evil Is Sexy, Hot as Hell and Cute Monster Girl rule), so why not ask her to become your girlfriend or wife? Of course, Most Writers Are Male, so it's extremely rare to see a female protagonist do this with a male devil.
Seem a little too anxious to sell your soul. (See the Frank Zappa example below)
Turn to religion. While rarely used in fiction due to it being too quick a solution, there are many cases when a saint or mystic claimed they (or someone they knew) sold their soul to the devil and were saved by Jesus or the Virgin Mary. In these cases, you merely consecrate yourself to him; the demon only literally gets the soul after death.
Prove you'd already sold or given your soul to someone else, a la Homer Simpson and Mr. Krabs.
Manipulate some tiny, arcane loophole or hire some Rules Lawyer to render the contract null and void. (Rarely successful, as Hell is full of lawyers after all. Then again, The Devil Is a Loser, so outsmarting him is not impossible.)
Use the power you gain from the contract to change the entire system, sometimes even retroactively.
Of course, the devil has been in this business since day seven. Therefore, the only way the villain of the piece can expect to get out of the "accounts receivable" column is by getting moved into the "owner's equity" column.
Sometimes this trope is played with by having the devil-analogue purchase something other than the seller's soul, such as a term of service (indentured or otherwise), their youth, their creativity, etc.
What exactly the Supernatural party does with all the souls they buy may or may not be elaborated on.
Power at a Price is the supertrope. Devil's Job Offer and Sold His Soul for a Donut are subtropes.
Compare Bargain with Heaven, which this trope originated as an Inversion of, but which is largely forgotten in the mainstream, but still very much in use in some contexts. Compare also Reasoning with God. For the occasions when the Devil comes out behind, see Did You Just Scam Cthulhu?. See also Evil Is Not a Toy, which this trope overlaps with. These types of deals are often Rash Promises, if the characters involved swear to honor their bargain without actually thinking through what they're doing.
Please note that this trope is about deals with the actual devil, or other demonic beings. A deal with a really evil but otherwise standard (meaning: not demonic) villain may be called a "Deal with the devil" as an analogy, but it's not an example; see Enemy Mine for those cases.