The cold, wet summer of 1816, a night of ghost stories and a challenge allowed a young woman to delineate the darkness, and give us a way of looking at the world.

They were in a villa on the shores of Lake Geneva: Lord Byron – the bestselling poet, too dangerous for the drawing rooms of England and in exile; his doctor, John William Polidori; Percy Shelley, poet and atheist, and his soon-to-be wife, 18-year-old Mary Shelley. Ghost stories were read, and then Byron challenged everyone in the group to come up with a new story. He started, but did not finish, one about vampires; Polidori completed "The Vampyre"; and young Mary, already the mother of a living child and a dead one, imagined a story about a man who fabricated a living creature, a monster, and brought it to life. The book she wrote over the following year, initially published anonymously, was Frankenstein or, The Modern Prometheus, and it slowly changed everything.

Ideas happen when the time is right for them. The ground had been prepared. Gothic fiction had been all the rage for some time: dark, driven men had wandered the corridors of their ancestral homes, finding secret passages and dead relatives, magical, miserable, occasionally immortal; while the questing urge of science had discovered that frogs could twitch and spasm, after death, when current was applied, and, in an era of change, so much more was waiting to be discovered.

Brian Aldiss points to Frankenstein as the first work of science fiction (which he defines as hubris clobbered by nemesis) and he may be right. It was the place where people learned we could bring life back from death, but a dark and dangerous and untamable form of life, one that would, in the end, turn on us and harm us. That idea, the crossbreeding of the gothic and the scientific romance, was released from into the world, and would become a key metaphor for our times. The glittering promise of science, offering life and miracles, and the nameless creature in the shadows, monster and miracle all in one, back from the dead, needing knowledge and love but able, in the end, only to destroy … it was Mary Shelley's gift to us, and we would be infinitely poorer without it.

• Terror and Wonder: the Gothic Imagination is at the British Library, London NW1, until 20 January.