The theory of a deal or a bargain with the devil has been a cultural motif for quite a long time, and is best exemplified by the German legend of the scholar Faust. The Faustian tale originated from the life of Johann Georg Faust, an alchemist, astrologer, and magician. Typically those that deal with the devil in Christian folklore are seeking some combination of youth, wealth, power, or knowledge (in the case of Tom Walker, the prize is immense wealth). The price for obtaining this is the bargainer's soul.
Throughout much of history, bargains with the devil were not just the stuff of folklore; they were thought to actually occur. Many thought that the bargainers also had to promise to kill their children at birth, take part in witches' rituals, or have sexual relations with demons. All witches and warlocks were thought to have made pacts with the devil, and this accounts for part of the great mistrust and hostility towards those accused of this during famous witch and warlock hunts such as the Salem witch trials.
According to lore there are different ways of conjuring a demon to make this sort of deal, including different rituals, invocations, and other summons. The demon will usually leave what is called a diabolical mark on the bargainer (the blackened fingerprint on Tom Walker's forehead) that serves as proof that the bargain was made. Sometimes the pacts are written, and when this happens, they're usually signed in the bargainer's blood or written into Satan's Red Book.
Deals with the devil also appear in the Bible; in the Synoptic Gospels (Matthew, Mark, Luke, and John) the devil promises Jesus worldly riches and eternal glory if he serves him, Satan, rather than God. The Temptation of Christ is a very famous account of the New Testament, and these temptations occurred while Jesus was traveling and fasting in the Judean desert.
A particular group (aside from witches and warlocks, as previously mentioned) frequently accused of devil pacts is musicians. Selling one's soul to the devil in exchange for musical mastery and fame is a common motif – in fact, the musician himself starts often rumors of this. Notable musicians who have claimed (or were accused) to have made pacts with the devil include Niccolo Paganini, Giuseppi Tartini, Tommy Johnson, and Robert Johnson.