After several seasons of disappointing reviews, writers on the USA network's mystery series "Psych" decided to get revenge. They crafted an episode involving a psychotic killer doctor. The deranged murderer's name? Ken Tucker, who in real life is the mild-mannered, 57-year-old TV critic for Entertainment Weekly magazine.

"It was never 'Dr. Tucker' or just 'Ken.' It was always 'Did Ken Tucker eviscerate the body?'" says USA original programming chief Jeff Wachtel.

Hell hath no fury like a TV writer scorned.

Mitch O'Connell

In the movie business, writers hand over a screenplay and creative power to a director. In television, the writer rules. Writers often make the creative and day-to-day managerial decisions, even if their work weeks can be unglamorous, pulling late nights in their sneakers surrounded by empty take-out pizza boxes.

They also possess a little-talked-about power: the written word as a way to settle scores, keep high-maintenance actors in line and poke fun at anyone who gave them a hard time in junior high.

With more network shows premiering this fall than in any of the past three years, and original cable shows continuing to multiply, more and more writers are creating TV episodes—and poking needles into a few voodoo dolls along the way.

For his part, Mr. Tucker says he was delighted to be the inspiration for a heinous villain in the "Psych" episode. "It shows you're not wishy-washy. You have strong opinions and people react strongly to them."

When the lead detective wants to discuss a serious matter with his partner in the drama "Detroit 1-8-7," which premieres on ABC Sept. 21, he will only talk via cellphone, even when the two men are in the same car or sitting together at a coffee shop. "That's a reference to a passive-aggressive Hollywood producer who will go unnamed," says executive producer Jason Richman, referring to a power player who goes to great lengths to avoid face-to-face confrontations.

Some gestures are more casual. Before he created "Mad Men," Matthew Weiner worked as a writer on "The Sopranos," where he put the name of a former employer who had wronged him on a gravestone in the background of a cemetery scene.

"Unless you're Spielberg or Scorsese," says "Cougar Town" co-creator Bill Lawrence, "there's no other gig where you have that kind of power."

A head writer (or "show runner") on a TV show is not only responsible for each script and the show's overarching narrative. He or she also oversees the cast, crew and production team and serves as a liaison to studio and network executives. A team of supporting writers helps develop story arcs, pitch ideas for characters and contribute dialogue.

The appetite of television is huge: 22 episodes each season, from September through May. For a network drama, that comes to a 52-page script every eight days, or the equivalent of producing about 10 movies a year. Writers are desperate for fodder. Sometimes it's ripped from the headlines; sometimes it's closer to home.

"When you're churning out an enormous amount of material in such a short period of time, you really do reach inward to locate personal experiences that you can extrapolate to your stories and characters," says Steven Bochco, co-creator of "Hill Street Blues," "L.A. Law" and "NYPD Blue."

I wish I had the talent to create a 50-page script in eight days. George Rasko George Rasko

"If there was an annoying kid in our lives, we'd do a show about an annoying kid," says Philip Rosenthal, creator of "Everybody Loves Raymond."

The practice isn't all puerile payback. A sharp pen and the threat of an unappealing storyline can help TV writers keep a production—and the egos involved—in check. In popular imagination, Hollywood is a place where luminous actors reign supreme and the brains behind the operation are secondary.

In reality, crossing a TV writer is "suicide," says actor Ed O'Neill, who played sad-sack dad Al Bundy on "Married with Children" and now plays the patriarch on "Modern Family." "I've heard many stories of someone getting brutally murdered on a show because they insisted on a bigger trailer," he says.

There's a common technique among writers, USA's Mr. Wachtel says. "When actors are acting up, you call them into a story session and say, 'You know, there's a very high mortality rate lately on the streets of Chicago'" or wherever the show is set. "Friends" spoofed the practice in an episode in which Joey gets a job on a soap opera. After he brags to a reporter that he writes some of his own lines, his character plunges down an elevator shaft to his death.

"Law & Order" creator Dick Wolf is legendary for his willingness to devise storylines that eliminate even the biggest-name actors if they get in the way of a production. NBC thought the legal drama wouldn't survive without Michael Moriarty as executive assistant district attorney Benjamin Stone. But after disputes led to the actor's departure, writers created a plot that had Stone promise to protect a witness, only to have the Russian mob rub him out. Stone resigned, Mr. Moriarty was gone, and the show went on for 16 more seasons.

Mr. Wolf says he learned an important lesson when he saw Lyndon B. Johnson take the oath of office after John F. Kennedy's assassination: "Everyone's replaceable."

Last year on "Desperate Housewives," Nicollette Sheridan's conniving Edie Britt died after almost being strangled to death, driving her car into an electrical pole, and then stumbling out of the car unaware she was standing in a puddle of water. A power line snapped and she fell to the ground, electrocuted. Ms. Sheridan says Edie's gruesome death was retaliation for accusing creator Marc Cherry of physically assaulting her. In April she made those claims in a $20 million lawsuit against Mr. Cherry, ABC and Touchstone Television Productions.

"We investigated similar claims made by Ms. Sheridan last year and found them to be without merit," ABC Studios said. A spokesman for Mr. Cherry says the decision to write Ms. Sheridan out of the show was made months before the alleged incident took place and that her character "had simply run its course." An attorney for Ms. Sheridan declined to comment.

To be sure, many TV shows rely on star power, and killing off the main character is not an option. "Moonlighting" creator and head writer Glenn Gordon Caron left the series after production problems and widely reported disputes with actress Cybill Shepherd. On the other hand, NBC managed to keep "Valerie" going after lead actress Valerie Harper was fired, renaming the sitcom "The Hogan Family." When CBS had recently undergone travails with Charlie Sheen of the hit sitcom "Two and a Half Men," Chief Executive Leslie Moonves joked to advertisers, "I'm happy I didn't have to come out here and try to sell you 'One and a Half Men.'"

To writers, bringing actors down a notch is sweet revenge. Some love to tell the story of the time an actor uttered a familiar lament to Mr. Bochco, the producer: "My character would never say that."

Says Mr. Bochco: "I told him, 'Maybe your character wouldn't say that, but he's not your character, he's my character, and he's saying it right here." He pointed to the script.

When actors were being demanding on hospital drama "Chicago Hope," creator David Kelley sent a scene to the ensemble cast in which hot-shot surgeon Dr. Jeffrey Geiger gives the fictional doctors a lecture about appreciating their profession and not being greedy. The actors got the hint; the scene was never shot.

Back when "Fantasy Island" was one of TV's biggest hits, producer Aaron Spelling called actor Hervé Villechaize into his office after the actor asked for yet another raise. He walked into the supposedly private meeting only to find that Mr. Spelling had assembled dozens of little-people actors, a clear message that he wasn't the only one who could shout, "The plane! The plane!"

Writers must be more careful these days with network legal departments cracking down on the use of real names, characters too close to real life or the offing of an actor for reasons other than story development. An interior designer who claimed he was the inspiration for the character Jack McFarland on NBC comedy "Will & Grace" sued co-creator and one-time friend Max Mutchnick for portraying him as "flamboyantly gay, constantly over the top, promiscuous and irresponsible," often wearing a turtleneck with a sweater tied around his neck. The case settled in 2003.

A writer on "Frasier" based Dr. Frasier Crane's high-school crush Lorna Lynley on an unrequited love of his own. Then he began to worry that the real Lorna would recognize her name and sue, especially since the character (played by Jean Smart) came back into Frasier's life as a chain-smoking, whiskey-swilling pill popper. First the writers pranked him, hiring an actor to serve him with a lawsuit. "It really freaked him out," says producer Christopher Lloyd, who worked on "Frasier" before co-creating "Modern Family." Later, they changed the name to Lana Gardner, without explanation. This placated the writer but confused some of the show's more attentive fans.

Says Mr. Lloyd: "There's no shortage of nerdy writers, each of whom had girls in high school that would never look at them and ended up in 'Frasier.' "

The network "suits" who the writers incessantly complain are meddling with their work are also an inviting target. "Seinfeld" regularly put executives into episodes, including a dour NBC chief, played by Bob Balaban, who gets food-poisoned after Elaine sneezes on his pasta primavera.

Former NBC entertainment president Warren Littlefield, who inspired the character, says he loved Mr. Balaban's interpretation and the digs at network TV. "You have a pretty big audience to air your dirty laundry if you need to," he says.

Another "Seinfeld" character was "Crazy" Joe Davola, who dressed up like a clown and stalked Elaine. He was based on an executive of the same name at competitor Fox, but only because show runner Larry David liked the sound of his name, and would repeat it again and again. The real Mr. Davola says he gave Mr. David permission to use his name, and has been receiving special treatment at hotels and restaurants ever since.

David Kohan, an executive producer with longtime collaborator Mr. Mutchnick on the new CBS comedy "$#*! My Dad Says" (pronounced "Bleep My Dad Says"), says comedian Elayne Boosler treated him so badly early in his career that he tried for years to get revenge. Finally, a character on his show "Boston Common" was stopped at the airport for making a wisecrack about a bomb. "He said 'You're going to arrest me for telling a stupid joke? Then why don't you arrest Elayne Boosler?'" Mr. Kohan says.

Ms. Boosler herself would never partake in such "petty payback," she says in an e-mail. "I've noticed that true success and happiness tends to erase narcissistic grudges, real or imagined, from memory. I love using my powers for good."

TV writers are unrepentant. "If we get cut, we can cut them back," says "Family Guy" creator Seth MacFarlane. In the Sept. 26 premiere of the new season of the show, a character is murdered with a blunt object—a Golden Globe statuette. It rankles Mr. MacFarlane that the show has never won the award.

Prizes were also a subject for a character in "The Sopranos" named J.T. Dolan, a writer with gambling debts. Down and out, he tries to pawn his Emmy award. "If it were an Oscar, maybe I could give you a little something, an Academy Award, but TV?" the clerk replies. Creator David Chase says the storyline "describes the life we all lead, waiting for meetings that never happen, winning an award and then not working for two years."

Unlike a movie, a TV show is a living organism, with storylines changing weekly. That means nods to real life can backfire. David Zabel thought it would be a nice tribute to name an earnest young medical student in "E.R." after his wife. A few weeks later, the plot called for killing her off. "I just couldn't do it," Mr. Zabel says. "I had to come up with a better storyline to let her live." (He did.)

One night, the writers on Fox's animated show "American Dad!" were at their bowling league. One of them put his iPod on the speaker system. After a few songs, the head of the league yanked it off, saying he didn't like their taste in music. Incensed, the writers crafted a character the next day which they referred to as "A--hole at a bowling alley." Even though that moniker wasn't used on the show, the character was.

"We would never say it to his face though, it's better to just air it on a prime time show," says Jordan Blum, a writer's assistant.

"We're all writers," adds co-creator Mike Barker. "If we weren't cowards, we'd be actors."

Write to Amy Chozick at amy.chozick@wsj.com or follow her on Twitter: @amychozick