With Battlestar Galactica rocking to an end Friday, the show's producers promise a bravura conclusion that will knock our socks off. But it's got some stiff competition - here are science fiction television's greatest endings. Spoilers!

The best television show endings don't just provide a satisfying conclusion to a serialized drama - they give you the sense that you've traveled, and arrived somewhere. They tie up at least some of the loose ends, and give some thematic resolution. But more importantly - they kick you in the ass and shock you. They make you go, "Wha? That's where this was heading?" By startling you, they make you view the whole series that's gone before in a new light.

Here are the top 10, in my book, from worst to best:

10) Doctor Who. By the late 1980s, the original Doctor Who had run out of steam, with silly storylines and weak production values. But the show's final season saw a bit of a renaissance, with a couple different storylines that addressed the theme of evolution in different ways. The final story, "Survival," brought back the Doctor's old enemy, the Master, and placed him inside a story about "survival of the fittest." Meanwhile, the Doctor's traveling companion, Ace, started evolving herself, reaching a kind of conclusion in this episode where she becomes more than human. The whole thing ends with a nice speech as the triumphant Doctor tells Ace they've got work to do.

9) The Hitchhiker's Guide To The Galaxy. The TV series, encompassing the first two books, and several large chunks of the radio series, ends on a lovely note. Arthur Dent and Ford Prefect are back on Earth in prehistoric days, and they get the question that goes with the final answer of life, the universe and everything... only it's slightly wrong. Still, it's a beautiful day, and they walk off through the prehistoric meadow as Louis Armstrong sings "What A Wonderful World."

8) Sapphire And Steel. A lot of this British show about two time travelers, played by David McCallum and Joanna Lumley, feels dated and slow now. But the final four part episode, in which the agents get caught in a time trap, is still as eerie and scary as it was originally. They're stuck in a roadside cafe where time appears to have stopped, along with a handful of people who claim to be from 1948. Normally, Sapphire and Steel can solve time-displacements just by using their wits, but this time they're out of their depth. "I saw the future... and it was our future."

7) Space Island One. This show about the crew of a commercially run space station had its ups and downs, but its last couple of episodes were among the best television I've ever seen. The company that owns the space station is trying to decide between shutting it down and just pulling the plug. And the station's best crewmember, Dusan, has already found a new job. But before Dusan goes, the company orders an unwise series of tests, which overload the station's equipment and cause it to go down in a blaze of glory, which not everybody survives.

6) Quantum Leap. Okay, all the commenters talked me into watching this finale, which I barely remembered. It's pretty great stuff, including Sam traveling back to where it all started and meeting a bunch of the people from his past jumps... And the bartender has some revelations for Sam that he struggles to take on board. So Sam makes one last jump, to the wife of an old friend... and you fade out to that message, "Beth never remarried. She and Al have four daughters... Dr. Sam Becket never returned home." Classic stuff.

5) The Prisoner. This is the most polarizing ending of them all - anyone who expected an actual explanation for the craziness which had come before would have been horribly disappointed. But anyone who wanted to see the craziness elevated to the level of Dada, and Number Six's latent egomania turned into the whole point of the series, found "Fall Out" an episode that just gets more rewarding the more you watch it.

4) Star Trek: The Next Generation. This is actually the textbook case of how to do a decent ending to a serialized show, and one that people reference all the time. After a couple of increasingly bland seasons, the show comes back with an episode that ties in with its original pilot as well as giving us a glimpse of the characters' possible futures. It feels grand and epic in a way the series mostly didn't feel after season five.

3) Babylon 5. Famously, this show filmed its Hugo-nominated final episode before the rest of its final season, allowing for some grand thematic resolution instead of a simple pay-off. "Sleeping In Light" takes place 20 years after the end of the Shadow War, and Sheridan is dying at last. He visits Babylon 5 on the eve of its decommissioning and destruction in a last blaze of glory, then prepares for death... except that a new adventure is waiting for him instead.

2) Blake's 7. Yet another show whose final season was drek, but then the actual final episode represented a huge return to form. Not only does the show's ostensible star, Roj Blake, come back from the dead, but we finally see a showdown between Blake and Avon, which seems to come directly out of all the mistrust and warped love the two shared during the first two seasons. You suddenly realize that, despite Blake being absent for nearly half the show's run, it really is all about Avon and Blake, the idealist and the uber-cynic. And it's never going to end well. (And for the record, Avon dies in the end. So there.)

1) Life On Mars. (British version.) I'm putting this at the absolute top because it redeemed the time-traveling cop show for me. Honestly, I was starting to lose interest in this show, even after only a dozen or so episodes. How many times can there be a crime, and Gene jumps to the wrong conclusion and tries to force it using barbaric methods, while Sam stands back and critiques Gene's racism and sexism? (And then, of course, the case turns out to have some connection to Sam's childhood.) I was dying for an episode where Gene was right and Sam was wrong. But the last couple of episodes totally redeemed the show for me, by asking: "How far will Sam go to get back to the present?" And then that turns out not even to be the right question, since the real question is, "Will Sam be happy when he finally gets back to his nice, sanitized boring future"? I have no idea how the American version will end, but somehow I doubt we'll see the American Sam Tyler killing himself, and it especially won't be portrayed as an understandable choice. Apparently this was voted #1 in a list of the 50 greatest TV endings. And apparently the show's makers just wanted to end it with him jumping off the roof.