Marvin does this in the first book when he connects himself to the cops' ship's computer so he can talk to it. When faced with Marvin's view of the world, the computer becomes so depressed, it kills itself, taking the cops shooting Arthur, Ford, Zaphod and Trillian with it by cutting off their oxygen units.
In Locked Within, Nathan crashes an SUV through a construction site to save Cadence and stop the Council of Chains from taking control of the soul eater.
In Silent Oath, Nathan and Elena swing in on ziplines to stop Morrigan sacrificing their friends as hosts for a demonic army. Earlier, Elena is this when she saves Nathan from a burning house after Athamar temporarily blinds him and leaves him to die.
In The Hobbit, Bilbo rescuing the dwarves from the spiders.
Happens again in the same battle, when Aragorn arrives with reinforcements on the ships of Umbar.
And at Helm's Deep, when the enemy forces were on the verge of completely breaking through the Rohirrim's defences, only for Gandalf to arrive in the nick of time with Erkenbrand's reinforcements and an army of Huorns.
In both The Hobbit and The Lord of the Rings, this is pretty much the Hat of the Eagles.
Happens in The Silmarillion too: Lúthien saving Beren from Tol-in-Gaurhoth is just one of many examples.
John Moore's Slay and Rescue opens with Genre Savvyhero Prince Charming (that's actually his name) carefully timing the rescue of a princess to achieve this effect. It's part of the job.
In Space Marine Battles, this happens so often it creeps over to Once per Episode territory. The most epic example would probably be the Legion of the Damned, for whom "showing up when the situation is the most dire and saving the day" is pretty much a job description.
In the 5th Young Wizards book, this happens when the Lone Power is giving Nita Its Evil Gloating speech. She's ready to give in...when her wizard partner Kit bursts in in the nick of time. "Fairest and Fallen, one more time...greetings and defiance." You can practically hear the epic music.
In Bill Baldwin's Helmsman series, the final battle of the first book is the protagonist having to hold off three ships. He actually thinks about this trope, about how the BDH only arrive on time in books. Since this is a book, a few cruisers do arrive — when half his crew is dead and the ship is good for nothing but scrap (and only half an enemy ship remains).
Malik ibn Ibrahim does this from out of nowhere in the second story in the anthology Wandering Djinn.
Sandor Clegane, of all people, gets a moment of this in A Song of Ice and Fire when he cuts through a mob just in time to rescue Sansa from being gang-raped by the rioters. This, naturally, sets up a Bodyguard Crush on Sansa's part and a great deal of Squeeing among the fans, as rescues are wont to do. How heroic he is the rest of the time is up for debate. Arguably, his first Big Damn Heroic moment is actually in the prior book, when his big brother Gregor is about to hack a stunned and helpless Loras Tyrell in two...only for the Hound to show up just in time to divert the killing blow and defend Loras till Gregor cools down.
Jaime Lannister, completely unarmed, leaping into a bear pit to distract said bear from Brienne. Jaime doesn't do much about the bear on his own, but the archers he brought back with him do. Made even better by Jaime's quip, after he asks if Brienne is still a maiden: "Oh, good. I only rescue maidens."
In the Dale Brown novel Air Battle Force, the Taliban deputy Turabi is about to be killed by an usurper when Chris Wohl in a Tin Man Powered Armor suit shows up and evens the odds in preparation for an Enemy Mine. In Plan of Attack the same chap gets saved again, this time from Russians.
In the 2nd Empire from the Ashes book, Colin appears just as humanity, after a long, hard-fought struggle, is about to be obliterated by Achuultani scouts, with the resurrected ships of the Emperor's personal guard in tow. Curb-stomping ensues.
Odd example in The Chronicles of Amber that straddles the line between this trope and Villainous Rescue: Corwin, the hero, is the one doing the rescuing—and he only decides to pitch in the moment he gets there. Prior to that, he intended to attack Amber himself.
Near the end of Terry Pratchett's Discword novel Monstrous Regiment when the Ins and Outs are about to be packed off and safely out of the officers' hair. Sgt Jackram bursts through the door to defend his "little lads". What with him being larger than life and having about 40 years of blackmail material in his head, he begins an epic verbal beatdown of the general staff to free his troops.
The Secrets of Droon—So, the kids are trapped in a room with rising water filled with poisonous serpents. They're all resigned to their fate. And then, Young Galen appears out of nowhere and magics the serpents out of existence.
In Time Scout, Kit and Malcolm come to 16th century Darkest Africa to rescue Margo and Kynan from Portuguese soldiers.
Subverted in Wagers of Sin when Skeeter crashes the Porta Romae just in time to rescue Marcus after a mad dash across La La Land. Also present is Lupus Mortiferus, who brutally clubs Skeeter down.
Played straight a few weeks later when Skeeter finally rescues Marcus and takes him home.
In Ripping Time, Armstrong shows up just in time to save Jenna from Jack the Ripper.
In The House That Jack Built, Kit and Skeeter catch up to Paula Booker and some guides being pinned down by native bandits outside Denver.
Also in The House That Jack Built, Skeeter tracks down his new adopted family after many weeks of searching so that he can help rescue them from The Syndicate.
At the end of Wrath of the Lemming Men, Space Captain Smith returns to his comrades on New Luton with the Vorl as his new allies, turning his hard-pressed colleagues' struggle for survival into a Curb-Stomp Battle against the enemy.
In The Brief Wondrous Life of Oscar Wao, Belicia (Oscar's mother) ran afoul of someone powerful in Trujillo's regime in her adolescence and some secret police thugs tried to force her into their car. She barely managed to call for the help of her old boss, a Chinese immigrant named José Then, as he was passing by. When he saw what was going on, he was on the thugs in an instant, handgun pressed against one's skull and with the determination to use it, personal danger be damned. Beli later told her daughter, "Mis chinos saved my life."
In Harry Potter and the Order of the Phoenix, Harry and co. are caught by Death Eaters and about to be killed unless Harry gives the Prophecy orb to them. Cue The Order of The Phoenix arriving just in time to even the odds.
A Brother's Price: "We Whistlers have an unbreakable rule — you mess with one of us, you mess with us all!" Played with, though, in that they weren't so much late as they were following the Big Bad, so that when she found the imperiled heroes, they would find them too.
Several times in the Mediochre Q Seth Series. Early on in The Good, the Bad and the Mediochre, Joseph Carrion turns up Just in Time to take down Isobel the pyromancer from behind. Towards the end, Mediochre catches up to Charlotte Just in Time to prevent Maelstrom from killing her. In the short story Born to Raise the Sons of Earth, Mad Lex Gunpowder dramatically breaks down the door of the cellar within which Joseph has been tied up, just when Joseph required a distraction to escape.
In The Honor of the Queen, there is an interesting Double Subversion: thanks to the decision by her subordinate and the admiral leading the rescue to remove the hyper generator safety interlocks, Admiral White Haven's battlecruiser squadrons manage to show up in Grayson literally an hour before the final, fatal encounter between Harrington's not-quite-crippled heavy cruiser and the Masadan's battlecruiser, and soon enough to intercept the latter before it gets range on the planet. Unfortunately, the not-quite-crippling of Harrington's ship includes the complete destruction of its comms and the crippling of its sensor suite, and as a result she doesn't know ... meaning that White Haven is reduced to firing broadsides of missiles at the enemy from light-seconds out of range and praying for the proverbial Golden BB.
In the short story "The Service of the Sword", Midshipwoman Abigail Hearns is trapped dirtside on a planet with a handful of Marines and a lot of really nasty pirates. Cue her really fucking angryCaptain, Michael Oversteegen, charging to their rescue, having kicked the everloving crap out of three heavy cruisers with his single cruiser and punctuated his victory by destroying the fourth and final cruiser with a single salvo. Bad. Ass.
The Exile's Violin: Gunslinger incites a crowd to riot in order to rescue Jacquie and Clay from a public execution.
In the first book of The Kingdom and the Crown a raider has attacked the camp of a wealthy Jerusalem family and is dragging the daughter toward a tent to have his way with her, when the local Zealots decide to intervene, driving the bandit off.
When the Aes Sedai have Rand trapped near the end of the sixth book in The Wheel of TimeLord of Chaos, a massed force of Aeil, soldiers under Perrin's command, wolves and Asha'man appear to save him.
Similarly, in A Memory of Light, when the trollocs are about to crush Elayne's forces Logain and the remaining loyal Asha'man appear and crush the trolloc hordes.
Again in AMOL, as Rand's forces at Shayol Ghul are away to be overrun, Elyas Machera and his wolves arrive to pull them back.
In Marked, Stevie Rae volunteers to be “the refrigerator” for Aphrodite’s ritual so that she can then pass on the location of the ritual to Damien and the Twins, so that when everything goes pear-shaped all four of them could step up and help Zoey save the day.
At the end of Hunted, just as Zoey and half her friends have just escaped from the House of Night, with Raven Mockers, Kalona, and Neferet closing in fast, with barely enough time to get a ritual circle in place, the other half of Zoey's friends show up and, by The Power of Love, defeat the bad guys.
When Neferet tries to mind control Stark, he decides to Take a Third Option and ends up almost killing himself rather than hurting Zoey.
In Beautiful Creatures, Macon interrupts Lena's trial in the gymnasium and verbally destroys pretty much everyone who dares to try to defend their persecution of Lena.
In the climax of The Way of Kings, first book in The Stormlight Archive, Dalinar Kholin, his son, and most of his army have been trapped on a plateau, pinned between two massive enemy armies, after his ally betrays him and pulls out with all of the portable bridges that allowed access to the plateau in the first place. One of the slave crews that runs such bridges has managed to get themselves "lost" and have a perfect opportunity to escape, but they sacrifice that chance by using their bridge to give Dalinar a way out.
In the Rainbow Magic series, in Clara the Chocolate Fairy's book, Lizzie the Sweet Treats Fairy arrives to change the chocolate floor into toffee.
Subverted in Warp World: Alicia shows up just in the nick of time to save Ethan from Jett, but then proceeds to debate whether or not she should kill Ethan herself.
Horatio Hornblower: In Lieutenant, the Spanish prisoners in Renown escape and make a very effective attempt to capture the ship in the middle of the night, taking the crew totally off-guard. Buckland is captured in bed, the sleeping crew is mostly unarmed and unable to fight back, and Bush takes over a dozen wounds before collapsing. Then Hornblower crashes the Spanish prize vessels into the Renown and sweeps across the deck with their fully armed crews, rallying the British sailors and retaking the ship.
In Of Fear and Faith, Phenix's sound thrashing by Sorrow is interrupted by North, August and Elin bailing him out of danger and taking on the enemy themselves. Although the three of them don't fare too much better.
In Devils Cape, after seemingly being killed, Sam Small retires, and even after his honorary niece takes up superheroing, only helps train and mentor her. When she is under attack and her Powered Armor is failing, though, he arrives just in time to intercept her attacker and rescue her.
In Shannon Hale's The Goose Girl Ani/Isi is alone at the mercy of people who have been trying to kill her for the last 250 pages, but just as they've finally decided how to play this, the Prince, the King, and the royal guard, who overheard everything burst out from a hidden passage. And then Ani's "Goose Guard" in the form of her fellow animal-workers show up.
In Divergent, Tris's mother shows up to save her from being executed.
In Insurgent, Tobias leads a counter attack just as Tris is rebelling against her captors.
At least one moment per book in TimeRiders, when half the team is at its worst in some historical screw-up, the other half leaps into action back at the base to put things right. Later on in the series, this happens the other way round too.
In the Doctor Who novel "Engines of War", the Doctor (crash)lands on top of several Daleks and Degradations, saving Cinder's life.
Llane has one in Eludoran when he arrives to rescue the hostages at the last moment. So does Pendarynn later on.
In The Hunger Games, Thresh saves Katniss from being killed by Clove, on behalf of her relationship with Rue. If he hadn't intervened, it's almost certain that Cato would have won the Games.
In Shaman Blues, Vulture swoops in at the last moment to save Witkacy when the latter is about to be put through Body Horror routine by the Old Ones.
In Dark Lord—The Rise of Darth Vader, when Vader has eliminated the other Jedi from the fight on Kashyyyk and is facing Padawan Olee Starstone alone, Roan Shryne pulls off a dramatic rescue, leaping from the Drunk Dancer's dropship, grabbing a fallen lightsaber with the Force, and killing Vader's chief stormtrooper in one motion, while Archyr picks off other troopers next to him, Guns Akimbo.
Aside from the prologue, Ben's first appearance in Star Wars: Kenobi has him charging in on his eopie to rescue Annileen and Kallie from a runaway dewback that has blundered into a sarlacc field. He grabs Kallie when Annileen hands her off, and then—unseen by either Calwell, but noticed by A'Yark—uses the Force to keep the dewback from crushing Annileen when it finally trips and falls.
When the Imperial Army seems to be at the brink of defeat by the horde, the Fugitive Legion suddenly appears, turning the battle's tide to the point that the horde's leader finally deigns to intervene.
When Karyl is locked in combat with said leader and the latter is at the verge of murdering him, out bursts Shiraa, who promptly turns Raguel into a chew toy.
Graystripe from Warrior Cats saves a young kit and later his best friend Firestar from Darkstripe in The Darkest Hour.
After being found as a Dark Forest Spy in The Last Hope, Ivypool is ganged up on by Hawkfrost, Thistleclaw, and Snowtuft. Fortunately for her, Hollyleaf arrives and fights all three of them off. But Hawkfrost gives her a killing blow in return.
White Fang: The titular wolf-dog (as a pup) tries to invoke this when he encounters humans for the first time, by yelping when he's in pain so that his mother would arrive. It backfires, for the men recognize the she-wolf as a wolf-dog who used to live among them.