This may refer to the story of Faust.
Faust is a successful doctor or alchemist, but dissatisfied with his life he sells his soul to the devil in exchange for knowledge and pleasure. Although he seems to get what he asks for, he ends up condemned to an eternity in Hell.
The Faust story has been reworked through the ages and appears in many forms. Best known are two plays: Doctor Faustus by Christopher Marlowe (1564-1593), and Faust by Johann Wolfgang von Goethe (1749 - 1832).