Taking the Heat

A crime has been committed, usually a murder. In the subsequent investigation, Bob seems to be going out of his way to make himself a suspect. He may confess right at the start, or just draw attention to himself by refusing to co-operate with the investigators, even when it would appear to be in his interests to do so. Or he may not make himself known immediately, but will suddenly show up at the cop shop two-thirds of the way through, ready to confess, even though he's never been a suspect. Why? Because he's Taking the Heat for Alice.

In a classical whodunnit, it will usually turn out that Alice is innocent after all, and Bob was acting on a misapprehension. (Whether Alice is more flattered by Bob's care or offended that he was able to think she'd done it will vary from case to case.) Some authors have gone for the double-whammy, where Bob tries to take the heat for Alice while Alice tries to take the heat for Bob, and in fact neither did it.

In more "cynical" series, it may instead turn out that Alice did indeed do it, but Bob has some reason for feeling she should be spared punishment: Alice can't handle prison, Alice has less than a year to live, the victim raped Alice and only Bob knows, Alice has a degenerative brain disorder and doesn't know she did it... And sometimes Bob may actually think he's protecting an innocent Alice - all while she's pulling his strings to get him to take the heat for her.

In classic whodunnits, the usual way to expose Bob's lie is by lying right back at him; in the same way as the murderer always gives away that he knows too much about the crime, Bob can be tricked into revealing he doesn't know enough. Saying "So it was you who shot him?" when the victim was clubbed over the head usually does the trick.

Contrast I Won't Say I'm Guilty.

Anime and Manga

 * Detective Conan recently featured a rather a rather sad case that was a two-part episode. The president of a small-time entertainment company was having some problems with a TV station's manager. The manager had been extorting him, and then wound up dead as the result of poison. The company president was discovered to have hidden some evidence, then tried to take the rap for the crime until the titular character revealed the true culprit.
 * Another example from the  case: Ran thought that   was the murderer, but he was planting evidence against himself to divert attention from the true murderer, his Broken Bird girlfriend. He was arrested too, but because he took the heat.
 * in Sailor Nothing. After all, while they have proof that did the act, they have no proof that he was doing it under someone else's orders.
 * of Magical Girl Lyrical Nanoha A's attempt to do this for their master, but as their master said, their captor already knew everything so it was useless to lie.
 * This happens in Ore no Imouto ga Konna ni Kawaii Wake ga Nai, when Kyosuke takes the heat for Kirino's H-games when their dad found out. This is particularly hilarious as this means Kyousuke admits he is (1) using Kirino's computer (2) in Kirino's room (3) to play H-games (4) of a siscon nature.
 * He does it again to help patch Kirino and her friend, Ayase's, friendship after the latter found out about her hobby. Really, this seems to be his plan A.
 * In Tantei Opera Milky Holmes, Cordelia lets herself go to jail for stealing bread rather than let Fish Paste, the girls' new pet cat, be thrown out, since she believes the cat is the only thing holding them together. She is freed, but prison warps with her mind a bit.
 * Attempted by  in Oniisama e....

Film

 * Played for comic effect at the climax of the 1996 movie Mrs. Winterbourne: the two main characters, both innocent of the murder that's been committed but thinking each other guilty, try to take the heat for each other. And then the two main supporting characters, despite having little or no idea what's going on, try just as insistently to take the heat themselves. It turns out
 * In The Maltese Falcon, Sam Spade demands that one of Mr. Gutman's minions takes the heat for the three murders. Spade is innocent of the murders, but the cops would blame him for them anyway. Therefore, part of the price he demands for the falcon is a 'fall guy' to take the heat.
 * The main character's husband does this - very briefly - in Chicago. He stops the moment he finds out why she did it.
 * In the movie I Love You To Death (loosely based on a real attempted murder) Rosalie Boca makes several attempts to murder her husband Joey for cheating on her with other women, and is helped by her mother Nadja and her friend Devo, who's in love with her. When the cops finally do find out, the three try to cover for each other by saying the other two had nothing to do with it. Nadja claims her daughter begged her not to kill Joey, but she went on anyway, explaining, "I'm her mother, I do what I want."
 * Happens thrice in The Dark Knight. First, Subverted by the gangster who changes his testimony on the stand to take the fall for Maroni's crimes. Shortly afterwards, he reveals his true purpose: To assassinate Harvey in open court. Second, Harvey Dent falsely confesses to being Batman, so the real Batman can still catch the Joker. At the end of the film,.
 * In the The King and the Clown the king's jealous consort frames Gong-gil, the king's new favourite, for defamation. Because Jaeng-sang's writing is identical to Gong-gil's (having learned by imitation) he is able to step in and takes the fall for it. Not that this is any better a solution to Gong-gil.

Literature

 * A favorite of many mystery-novel giants.
 * The Moonstone by Wilkie Collins, the very first English detective novel, used this trope. The two main suspects (both female) turn out to have been independently covering for the same man, whom they both love, after seeing what each believes to be proof that he stole the eponymous gemstone.
 * Agatha Christie loved this trick, and even worked in the occasional subversion -- like revealing that Alice and Bob were in it together the whole time, and each blamed themselves alone in order to throw Poirot (or whoever was the detective that time around) off the scent.
 * Sherlock Holmes: a character caught red-handed with a gold circlet refuses to talk, because the real culprit is his stepsister. And he's in love with her. Curiously, Holmes interprets his stubborn silence as a sign of innocence - otherwise he would have made up an alibi.
 * Nero Wolfe, a major part of the plot of The Second Confession. The first confession, signed by a patsy, is phony. Wolfe makes him tear it up, and elicits a second confession from the real murderer.
 * Used in the Discworld novel Feet of Clay, much to Sergeant Colon's confusion: "You got a confession and there it ended. You didn't go around disbelieving people. You disbelieved people when they said they were innocent. Only guilty people were trustworthy."
 * Used in Margery Allingham's Albert Campion novel Death of a Ghost.
 * Figuring out why this is happening makes up most of the plot of Iorich. Aliera was arrested on a very stupid, transparent charge and she refuses to talk to a lawyer or put up a decent defense. Vlad decides that even if she is a Jerkass, he'd still prefer she didn't get executed, and he finds the idea of her owing him her life hilarious.
 * In Dorothy L. Sayers's Lord Peter Wimsey novel Nine Tailors, two brothers both try to cover for each other. The police throw them into the same room and eavesdrop. When they both realize that the other didn't do it, they both cooperate.
 * In O. Henry's Friends in San Rosario a banker tells the story of a time when the contents of his vault disappeared, and his best friend confessed to losing it all in a poker game. He later discovered that his friend had seen him stealing it, not realizing that he was sleepwalking at the time.
 * In Jim Butcher's Turn Coat, takes the rap for  for the murder of a senior member of the wizards' White Council, since.
 * In The Westing Game, takes the heat for the bombs  set, going so far as to set a bomb of her own.

Live Action TV

 * Occasionally seen on Law and Order.
 * Sometimes in modified form, where people confess on the stand to create reasonable doubt for the current defendant but have no intention of ever actually being prosecuted themselves.
 * Subverted in one episode of Law and Order: Criminal Intent: a woman confesses to killing her husband, but gets the details wrong. The detectives figure she's taking the heat for her lover.
 * Rumpole of the Bailey: The case where the defendant was found standing over the victim's body and immediately said "I did it."
 * Foyle's War has done several variations.
 * The miniseries Blackpool did a beautifully-executed subversion: After one of the detectives makes it clear that he has it in for the main suspect, the suspect's son confesses to the murder. Everyone immediately realises that he's Taking the Heat for his father, and he's let off with a warning about wasting police time.
 * A union leader in Life On Mars tried to cover up a fatal industrial accident at his mill to keep it from being shut down (and his members losing their jobs) by confessing to having murdered the accident victim.
 * In the CSI episode "The Unusual Suspect", the accused's 12-year-old sister takes the heat mid-trial. She later points out that, as a juvenile, she'll only be in prison until she's 21, and the book rights to her story will be worth millions.
 * In a CSI New York episode, a guy walks into a police station holding a gun claiming to have shot a doctor. He turns out to have been taking the heat for his wife: the guy had a terminal illness and the doctor had conned the couple out of their savings with a quack treatment involving leeches leading the wife to shoot her. He wanted to be sent to jail in her place seeing as he didn't have long to live.
 * An episode of Columbo ended with a friend of the murderer confessing to the crime; because of a brain tumor (that was going to cause her death in an estimated six months) the murderer didn't remember that she committed the crime. As he's being taken away, Columbo, who knows the truth, gently points out that the evidence will eventually show he didn't do it. The confessor agrees, but figures it would probably take about six months or so for that to happen.
 * In the Keen Eddie episode "Black Like Me", the character Georgie turns himself in and confesses to a jewel heist. Eddie refuses to believe that Georgie is a criminal and figures out that the girl Georgie loves asked him to take the fall, so she and her real boyfriend, a murderous crook, can get away with it.
 * Bones: Temperance Brennan gets the defense to portray her as someone with the motive and opportunity to kill the victim (albeit justifiably) to provide reasonable doubt for a jury during her father's trial.
 * One episode of Due South had a couple trying to take the heat for each other in a murder case. Neither was guilty, but because both had a reason to want the victim dead and weren't looking in the right direction at the moment the murder occurred, they each believed the other was responsible until Fraser learned about and captured the actual killer.
 * On an episode of The Glades, a potential suspect, who otherwise denies the crime and has the potential for a good alibi, immediately confesses to the murder when he finds out they have DNA of the killer and all they have to do is test him to have conclusive evidence. Jim immediately believes the confession is false and done to prevent any DNA comparison, because enough people have seen forensics on TV to know that DNA can show people are related, in this case showing that the man didn't commit the crime but a close blood relative (his son) did.
 * On Castle, when the mother of a 2-kid family was being taken in for questioning about the dissappearance and possible murder of the other 3,
 * On My Name Is Earl, Joy is on her third strike after stealing a truck (that happened to have someone in back). She almost goes to prison, but Earl sees that Darnell and the kids are already starting to suffer without her. So even though he didn't do it (although he did help Joy try and cover it up), and even though he knows he'll lose his newly-acquired job, apartment, and girlfriend, Earl says that he did it and that his fingerprints are all over the truck (which they are). He goes to prison for most of Season 3.
 * In Thirty Rock, Tracy Jordan makes his first "serious" movie Hard To Watch, which ends with his character volunteering to confess to a crime his brother committed.

Video Games

 * In Phoenix Wright: Ace Attorney, in the final case of the third game,  Oh hell,just go look up the case on Game FAQs and have fun figuring it out, this troper's brain -still- hurts.
 * More straightforwardly, case 5 of the first game has the client trying to take the heat for . Although.
 * In Case 3 of Ace Attorney Investigations,.
 * Played silly in Ghost Trick, where both Missile and Sissel treat Missle's taking the blame for breaking Lynne's headphones (to protect Kamilla) as the noble act of a warrior.

Western Animation

 * Seen in an episode of Fillmore, when a suspect took the heat in exchange for the real culprit's help getting his sister into school politics.
 * A two-part episode of King of the Hill uses the double-whammy version.