In Edgar Allan Poe's "The Pit and the Pendulum", a prisoner of the Spanish Inquisition faces psychological and physical torture in a dark cell. He struggles to survive deadly traps, including a sharp pendulum and a deep well, using his ingenuity to escape.