Mary Shelley's novel, Frankenstein, came about as part of a pact made between herself, her husband (Percy Bysshe Shelley), Lord Byron, and John Polodori. The four decided to "each write a ghost story." Mary Shelley details the events which surrounded the creation of her tale in the 1831 introduction to her novel.
Mary settled down "to think of a story." many mornings went by and none of the four had been able to come up with a ghost story. After many conversations, where Mary sat quiet listening, talk turned to Charles Darwin and his vermicelli rice grain which moved. That night, Mary had a dream, or, more true, a nightmare.
Mary dreamed of a "pale student of unhallowed arts," who toiled over a hideous being, and his success at bringing the creature to life. The student falls asleep and is soon awakened by the "horrid thing...looking on him with yellow, watery, but speculative eyes." Here is where Mary awoke from her own nightmare.
The following morning Mary told the other three about her dream through the first pages of a short tale. Excited about her story, her husband pushed her to complete the tale. Mary even gives her husband the credit as being the one who wrote Frankenstein: "my husband, and yet but for his incitement, it would never have taken the form in which it was presented. From this declaration I must except the preface. As far as I can recollect, it was entirely written by him."