The narrator of the story is in prison in Toledo, Spain. He is a victim of the Inquisition. He is in complete darkness. He attempts to discover the type of dungeon he is in by walking around the exterior of the room to find its perimeter. As he walks, he discovers that it appears to be circular in shape, but he has no way to mark where he started from. This is when he tears off a piece of his garment to lay on the floor. He continues his walk around the wall to arrive back at the torn rag on the floor.
Next he decides to go across the floor. He stumbles and falls face first on the floor because the rag is entangled in his feet. This saves him from the pit which is directly in front of his face. If he had taken a few more steps, he would have stepped right off the edge and landed at the bottom.
After awakening from a drug induced sleep, he found himself strapped down to a wooden platform with a pendulum swinging above him. He used the food to lure the rats from the pit to chew through the ropes that held him. Once he escaped the pendulum, he was free, but still in the prison.
He is saved just before being forced into the pit by the walls of the cell being heated and getting closer and closer so that he had no choice but to go down into the pit.
It is a great short story that should not take more than 20 or 30 minutes to read. I encourage you to read the story for yourself.