Wikipedia defines speculative fiction as:
a broad literary genre encompassing any fiction with supernatural, fantastical, or futuristic elements.
I would distinguish the following subgenres of speculative fiction:
- Science fiction
- Alternate history*
*Wikipedia considers alternate history as a subgenre of science fiction. However, I would place alternate history besides the other speculative fiction genres.
Science fiction is, as least in my humble opinion, the branch of speculative fiction that deals with scientific progress and its applications in society, often set in the future. However, the mere fact that a story is set in the future does not make it science fiction. For instance a story about the 2016 US presidential election without significant scientific or technological progress, would not qualify as science fiction in my eyes.
Fantasy is the branch of speculative fiction that deals with stuff like magic. Though fantasy and science fiction are often conflated by the “main stream”, these two are distinct genres. Asimov defined the difference as “fantasy is the impossible you want to be true, and science fiction as the possible you don’t want to be true”.
Horror centers about shocking or frightening the reader (or at least the characters). As such horror could overlap with both science fiction (aliens, genetically engineered monsters) and/or fantasy (vampires, werecats).
Alternate history is speculation in the purest form and deals with the difficult what if-in history. Stories in this genre typically deal with, what if Germany had won World War I, or what if George W. H. Bush had been reelected.