Poe was a master at creating spooky and suspenseful moods in stories. In "The Pit and The Pendulum," his narrator is subjected to gruesome torture during the Spanish Inquisition.
Poe toys with the narrators senses, creating a dream-like state of the narrator's judgement. The judges sound like a "dreamy hum," and then fade out, and shapes of candles appear as angels and become unclear again, and everything disappears into darkness. The narrator awakens into pitch black darkness, and fades in and out several times throughout the story. By telling the story through this narrator, the reader feels as though they, too, are moving in and out of consciousness.
When he next awakens into light, there are terrible images, and most prominent, an image of Father Time holding a razor sharp pendulum that is getting closer and closer. Poe toys with the ideas of light and dark, and creates a swinging pendulum to count down the time that the narrator has left.
The use of these sensory shifts and the description of the terrifying images, tiny suffocating space, the counting down of the swinging pendulum, and the closing of the walls all lend to the tense, horrifying atmosphere of the story.