It seems that the origin of the story dates back to the 16th century as a morality tale in Germany.
Doctor Johannes Faust really existed. He was born in 1480 in the city of Knittlingen in Wurttemberg and was a famous magician known for his interest in necromancy. His public career extended from 1510 to 1540.
Between 1528 and 1532 the humanist Melanchthon really met Dr Faust giving of him the image of an impostor who affirmed that it is not necessary to venerate God since he himself through God-like powers was capable of performing miracles. He died under mysterious circumstances.

The popular fantasy gave birth to the legend which refers to the bargain he made with Lucifer selling his soul in exchange for knowledge of the unknown.

In 1587 an anonymous, but surely Lutheran, writer publicized the Historia von D. Iohan Faust which was didactic in tone and aimed at advising men not to choose evil. After a few years, an English translation by a writer who is known as P.F. had appeared and a surviving copy dated 1592, the 'Damnable Life', is now in the British Museum.

New German editions:

Widdmann's Historia

Pfizer's Historia

anonymous poet known as
der Christlich Meynende

All those stories contain Faust's thirst for power, the pact with Lucifer, Faust's marriage with the beautiful Helen of Troy.

New English editions.

1604 (A-text)
The Tragicall History of D. Faustus printed by V. S. for T. Bushell

1616 (B-text)
The Tragically History of the Life and Death of Doctor Faustus printed for John Wright

But why was the story so successful? The importance of a character who is not so noble has to be found in his quest for knowledge. In him it is possible to find the dichotomy between faith and science, religion and reason. The most important part in the legend is Faust's death and his destiny with the consequent damnation of his soul.
In 1586 Cristopher Marlowe (1564-1593) elaborated the theme of the story. Marlowe intended to save his hero and tried to do so through Faust's repentance in the last hour of his life but, his sin is so enormous that his prayers cannot save him. However, even though he is condemned he becomes a symbol of man's triumph over nature appearing as a modern figure .
The play was performed by English actors in other countries among which Germany and there have been very famous theatre versions since then .

G.E. Lessing (1729-1781) was attracted by the story of this man who wanted to discover the mystery of the unknown. He wondered how could a man be damned in the using of his rational faculties.
Lessing wanted to write a drama in which the role of Lucifer was taken by a friend of Faust's . But the drama was never completed. It remained a fragment written in a letter.
We know that Lessing wanted to save his hero, even though his desire for knowledge had led him to go beyond human limits. God himself would not have given him the ability to reason, the most noble among his instincts, only in order to damn him and make him miserable. In this idea lies the rational conception of the Age of the Enlightment.

Many Romantic poets modified the myth of Faust. The hero loses his titanic force, his thirst for knowledge, he is now an ordinary man who turns to Lucifer only in order to gain power, wealth and happiness. In these works Faust is killed by Lucifer and condemned to damnation.

The writer who gave the legend new force was J.W.Goethe (1749-1832). It seems that he knew the story through the performances of the English shows. His Faust has all the rational characteristcs of the Enlightment, he is not a magician any more but a modern scientist, he has studied philosophy, law, medicine, theology. But he has Romantic aspirations,too. He represents free man who does not depend on external forces , a man who is at the centre of the universe, master of his own destiny.
Goethe's Faust is the first to decides the conditions of the bargain while in the other works it was always Lucifer who decided the details. In doing so, the good side of man has prepared a trap for Satan, the personification of evil.
Faust and Satan talk as modern men but the story is very similar to the traditional legend.
When Satan is already sure of his victory over Faust, angels appear and take Faust's soul into Heaven.
But, how is Faust saved? How does Faust solve the problem between faith and science with its thirst for knowledge? Goethe does not see any dichotomy between God and man because to him man himself is God. He is guilty and shows no repentance during his last hour but is saved by his desire for knowledge on behalf of all humanity.

Lenau's Faust (1802-1850) is also the author of his own destiny. He is not killed by Lucifer but commits suicide because he cannot overcome the problem of his pride and the feeling of dependence on God. In the melancholic universal sorrow of Lenau's version, which Goethe had solved through the actions of his hero in favour of humanity, the dichotomy between the divine and the human side is here once again like a painful wound.
Incapable of finding a meaning in life he stabs himself and Lucifer reveals himself a winner who before Faust's body affirms that evil and eternal damnation are a reality.

Thomas Mann (1875-1955) wrote a version of the story Doktor Faustus . His hero is a composer, Leverkuhn, who is cruel even because of his sickness. During one of hallucinogen dreams he sees Lucifer who promises to help him with his work and to give him great artistic power in exchange for his soul. Leverkuhn accepts and during the twenty-four years he becomes very famous but he is a man who brings sorrow and ruin expressing Mann's idea of the responsibility of the German people in the world catastrophe during the period from 1884 to 1955.
Faust is again the symbol of humanity, but of a desperate humanity.
The only one who was successful overcoming desperation through the sublime harmony of his classic and humanistic vision of life is Goethe.