Bulgakov starts The Master and Margarita with a quote from Faust, probably the most famous work of the German writer, scientist and philosopher Johann Wolfgang von Goethe (1749-1832):
"... who are you, then?
I am part of that power
which eternally wills evil
and eternally works good."
Goethe was inspired by the person of Doctor Johannes Faust (circa 1480-1540), a German magician and medical practitioner. He had also studied astrology, chemistry and philosophy.
The rumours and legends about him started already during his life. It was said that he practiced Black Magic. It isn't exactly known how nor when Doctor Faust died, but he probably was killed. Others say that he died from an explosion that happened as a result of his alchemistic experiments. Around the time of his death, supposedly around 1540, rumours arose that he had made a pact with the devil. Faust could not keep his hands from young boys, as was shown by measures taken by the city of Neurenberg in 1532 against this "Doctor Fausto, dem grossen Sodomitten". In addition Faust had apparently heterodox ideas, which made that Luther expressed his condemnation too. Some experts think that the major part of the allogations against Faust came from Luther and other clergymen. They were tough on him because they didn't like his ideas. Unfortunately it's almost impossible to find out what exactly were Faust's ideas. But this aversion explains why Faust is seen in European cultures as the archetype of the magician who sells his soul to the Devil in exchange of material and immaterial pleasures.
Goethe based himself on this historical character to create his magnum opus Faust, from the twentieth year of his life and at intervals. He only finished it at the last moment, just before he died.
The book Faust starts in Heaven, the Devil is visiting God to talk to Him about one of his creations: the man, Adam. To the Devil this is a contemptuous creation and he has objections both against man himself, as against God's reasons to create him. God is convinced that man is basically good and he thinks man's able to stay on the straight and narrow path, but the Devil doubts it and he's convinced that he can lead man - in the person of Faust - astray. God tolerates Mephistopheles' brutality because he understands his role in keeping man to the straight and narrow path, but at the same time he's convinced of man's capacity to stay on the right track. This high level of attributing self-determination to man doesn't correspond to the traditional christian opinion on God being almighty. But anyway, Goethe's Faust is thus the stake of a squabble between God and Mephistopheles.
After this Prolog im Himmel we see the scientist Faust in at night. He's in despair because of his insufficient knowledge. He's a prominent professor, aware of the limits of human knowledge, but skilled in magics. He must admit to himself that his studying and thinking, in search of the highest possible knowledge about man and the world, did not produce results. Then a little dog, a poodle, slipped into his studyroom.
The poodle transforms into the Devil, Mephistopheles, to whom Faust sells his soul. He accepts a bet with him to acquire the vividly desired knowledge. Faust willn have to change his approach. If studying and book learning can't help him, he will have to follow Mephistopheles’ advice. Only an introduction to real life can offer him the required insight. That's why he leads Faust to the Auerbachs cellar in Leipzig to get acquainted with the students' life and with the Hexenküche, where the stiff scientist is changed into a cool and relaxed young man by a witch.
Faust meets the innocent and naive girl Margarete, also called Gretchen. This dramatic love story is the focus of the rest of the first part of Faust. Gretchen gets pregnant from Faust and in order to avoid the scandal of this unmarried pregnancy the very religious Gretchen kills her child. She is condamned for this baby murder and put in jail.
Faust wants to blame Mephistopheles for all this evil in his life, but the Devil shows Faust his own responsibility. Eventually Faust tries to free his beloved from jail. But Gretchen refuses his help. She doesn't want to stay on earth with a bad conscience, nobody can help her anymore. While Faust is prepared to forget what happened, Gretchen assumes complete responsibility for what she did. At the end of Faust I she is assumed in heaven for her religious tenacity.
At the end of Faust I Mephistopheles seems to win it from Faust, but Goethe writes a second part, which he finishes just before his death in 1832. At the end of his long quest Faust wins from Mephistopheles. He came to the conviction that the worrying about the meaning and coherence in the world isn't worth much. Freedom has to be conquered every day again!