This was during a particularly stormy summer in 1816, also known as "the year without a summer" due to the effects of the eruption of Mount Tambora.
The group, bored by the bad weather, decided to have a contest to see who could write the best ghost story. It was during this contest that Mary Shelley conceived the idea for Frankenstein.