There are few TV programs that I watch these days, and even fewer that impress me with the quality of their acting, writing, directing, and scoring. Doctor Who is one of them.

The penultimate episode of Series 9, “Heaven Sent”, may well be one of the best episodes of Doctor Who, and one of the best episodes of television ever.

If you have not watched “Heaven Sent”, obviously there are spoilers here, and you should turn back now.

The writing

First, the writing. Steven Moffat has a history of extreme variabiity in the quality of his scripts. When he is good, he is brilliant, for example “Blink” and “The Girl in the Fireplace”. When he is bad, he is excruciating, see “The Doctor, the Widow, and the Wardrobe”.

In “Heaven Sent”, he is brilliant. There has never been a Doctor Who episode like this. This is both a “bottle episode” and a single-hander, with just one real speaking role. Moffat has to create a script that will keep us interested for approximately 50 minutes, with no one for Peter Capaldi to talk to.

Moffat succeeds. (Indeed, one observation I would make is that Moffat has been at his best when he experiments: “Blink” and ”The Girl in the Fireplace” were both experimental in one way or another.)

Here, Moffat delves into the seemingly random acts of the Doctor and see that there is often an underlying logic behind what he does: plucking flower petals and letting them fall to determine air resistance, dropping his loupe to estimate gravity, throwing a stool through the window and counting how long it takes to hit the water, and scenting salt in the air to confirm that the castle is standing in the sea.

But more importantly, there are lines that make you feel. Moffat has always had a talent for this, and here he throws it at you, fast and furious.

The day you lose someone isn’t the worst, at least you’ve got something to do. It’s all the days they stay dead.

Whatever I do, you still won’t be there.

The acting

Peter Capaldi is a remarkably talented actor, certainly one of the finer British television actors that I can recall having seen. In “Heaven Sent” he demonstrates his full acting range. And what a range!

This is a “bottle episode”, and one in which there is effectively only one actor with speaking lines, Peter Capaldi. Steven Moffat delivers one of his finest scripts, and Peter Capaldi knocks it out of the ballpark. I dare anyone to watch the last 20 minutes of “Heaven Sent” and not feel the Doctor’s despair, his grief, his pain.

We can believe that this is a man who has just lost someone very dear to him, and is now faced with a no-win scenario where he must suffer, and suffer, and suffer for billions of years, for the slim chance of being able to escape his prison and find those responsible.

Capaldi has a face that seems made for rage, with a fierceness that was lacking in his predecessors, Matt Smith and David Tennant. He channels the Doctor’s righteous anger and pain like no one else, speaking with a level of maturity and worldliness that the younger Matt Smith could never achieve.

Can’t I just lose? Just this once? Easy. It would be easy. It would be so easy.

We see his despair, his hopelessness, as he slumps against a wall made of something “400 times harder than diamond”, and contemplates how long it will take him to break through it, with nothing but his bare hands.

This, ladies and gentleman, is how an actor takes a role and makes it unmistakably his. Capaldi is the Doctor, in a way that he wasn’t, before this.

The directing

Rachel Talalay takes the next step to making this episode truly fantastic. She evokes a sense of horror and claustrophobia perfectly. The tracking shots of Capaldi as he runs down the corridors to avoid the Veil are hair-raising the first time you watch it.

Talalay knows when to come close to Capaldi‘s face, to show us the fear, the hopelessness, the despair, and finally, the determination. She makes a number of excellent choices when it comes to the lighting of the sets, keeping a great many of the scenes lit very starkly, so that the shadows accentuate the lines of Capaldi’s face.

And perhaps most importantly, the final montage captures the endless, terrible repetition of the Doctor‘s life in this prison and torture chamber. He lives, explores the castle, realizes what he must do to get out, dies, drags his dying body to the teleporter and burns up his dying body to power the teleporter and make a “copy” of himself to repeat the process, for more than two billion years.

This episode did not feel like an episode of television. It felt like a short movie, especially in terms of the sets, the cinematography, and everything.

The scoring

Murray Gold has been the composer for Doctor Who since the beginning of the new series in 2005. He has been a fairly serviceable composer, delivering occasional moments of brilliance.

This episode, he knocks it out of the ballpark, too. I want the BBC to release the soundtrack for this episode. Soon.