First, decide whether your mystery is "open" (meaning the viewer knows whodunit from the start), or whether it is "closed" (meaning we the viewer find out what or who the killer is the same time that the hero does).
Paraphrasing Lee Goldberg from the Mystery Readers Journal:
An open mystery works when both the murderer, and the viewer, think the perfect crime has been committed. The pleasure is watching the hero unravel the crime, and find the flaws you didn't see. A closed mystery works when the murder seems impossible to solve, and the clues that are found don't seem to point to any one person, but the hero sees the connection you don't and unmasks the killer with it.
According to Goldberg, 'Columbo' mysteries were always open. In more recent television shows, we see open mysteries on 'Law & Order: Criminal Intent', even 'Heroes' and 'Dexter' are open to some degree, and a lot of the 'X Files' were open mysteries (as in we usually knew 'who' or 'what' was up to no good, we just didn't know 'how' they were doing it)....but just about everything else on network TV these days are closed mysteries or a mix of the two (as in they start closed, and then open up). The CSI's, the Law and Order's, Medium, Criminal Minds, Cold Case, Bones...even more dramatic shows like House and Lie To Me are all structured around a closed mystery.
Some shows (like House) will hold off solving the mystery and revealing the killer (or disease) until almost the very end (Act 5, or is it Act 6 these days?), but most shows reveal the killer/'monster either at the mid point or by the end of act 3 so the hero can 'catch' whoever or whatever the bad guy is. (I say whatever because I'm primarily experienced in genre mysteries (sci fi, paranormal, etc.) where the bad guy can be a bad 'thing'.).
And when it comes to constructing the plot for good genre mysteries (like X Files; Buffy; Angel; Firefly...and today you've got Supernatural; Smallville; Warehouse 13; Sanctuary; even Chuck, etc.), there is one question always be asked:
What is it...what is it really.
(In the case of procedurals and investigative mystery programs like 'Veronica Mars' or 'Castle' or 'Bones', the mantra becomes: Who is it...who is it really.)
Take that tip to the bank, baby.
We put this principle into practice constantly on 'The Outer Limits', 'Earth: Final Conflict', and 'Psi Factor' (as in, if it looked like a werewolf wreaking havoc, it damn well better not turn out to be a werewolf). And we studied and learned from the master, Joss Whedon.
Whedon (Buffy, Angel, Firefly, Dollhouse) and his disciples execute this principle to perfection in their shows. It was always a closed mystery, and would usually remain that way until the mid point or end of the third act. If you thought Buffy was losing her powers and Giles was out to harm her, it would turn out that Giles was preparing his Slayer for a rite of passage test set for her 18th birthday. Or if Buffy thought swamp creatures were eviscerating members of the school swim team, the reveal would be that the swimmers were actually turning into creatures themselves because of all of the steroids the coach was feeding them.
What is it...what is it really.
Of course, this is just one aspect to telling a good mystery story. To take it to the next level, you also need to pick an overall theme to flesh out the episode. Whedon would take something dramatic like 'honesty is best policy' or 'believe in yourself' and let the character conflict drive the drama in conjunction with the unfolding mystery. Yet he always kept you on your toes, and tended to not only play the 'what is it...what is it really' card in the overall story, but even within individual scenes.
Here's the opening from his pilot for the 'Buffy the Vampire Slayer' TV series...
EXT. BERRYMAN HIGHSCHOOL – NIGHT
The buildings of the affluent Southern California school gleam darkly in the moonlight. We TRACK about the campus – it's deserted.
INT. HALL – CONTINUOUS
TRACK through the halls. Nothing.
INT. CLASSROOMS – CONTINUOUS
We track along the wall, past the maps and drawings tacked up on it, past the window, which SHATTERS in our faces!
It's just a single pane, knocked in by someone's hand. It unlocks the window and slides it up.
EXT. OUTSIDE THE BUILDING – CONTINUOUS
The intruder is a college age BOY, a timid GIRL beside him. She looks about nervously.
Are you sure this is a good idea?
It's a great idea! Come on.
INT. CLASSROOM – CONTINUOUS
As they climb in. She peers around some more as he shuts the window behind them.
You go to school here?
It gets better. Come on.
INT. BACKSTAGE – A BIT LATER
He leads her through the back of the school theater and
ANGLE: ON STAGE
which is lavishly dressed as an over-sized alley set: a huge wooden fence, trash cans, etc. It looks suspiciously like the set of CATS. She wanders through it a bit.
Suddenly the curtains open, revealing the empty auditorium, and the foot lights come up. The boy has worked all this from the side of the stage. He comes up to her.
I'm sure we're not supposed to be here…
He moves to kiss her, but she turns suddenly, real fear crossing her face.
What was that?
What was what?
I heard a noise.
Maybe it's something…
Maybe it's some Thing…
That's not funny.
He looks about them. The place is dark shadowy. She cowers behind him.
There's nobody here.
Are you sure?
She bares HORRIBLE FANGS and BURIES them in his neck.
Simple. Clean. Effective. And with a Twist. A nervous girl is led into a school by a horny boy. It's late at night. It's a little creepy. He's a little creepy. We're nervous. We're concerned for her well-being. And it turns out he's the one we should have been concerned for. A perfect example of good 'what is it...what is it really' mystery story-telling, from the man who had Buffy the vampire slayer fall in love for the first time with...a vampire, of course (albeit one with a soul).
SONG&ARTIST? - "Romeo was restless, he was ready to kill.
He jumped out the window cause he couldn't sit still.
Juliet was waiting with a safety net.
He said "Don't bury me cause I'm not dead yet"..."