"Castle" Season 6 Episode 11, 'Under Fire', opens with Beckett receiving a call from Jenny. A worried Jenny calls-up Kate as she is unable to contact Ryan. Beckett tells her to calmly listen to what she has to say. The scene shifts to some hours before.
Castle, Beckett and Ryan are investigating the death of an unidentified person in a building gutted by fire, which alludes to a deliberate arson attack. The victim's body has been charred beyond recognition as well as all the things on him are burned, including his wallet. It is soon established that the person died before the fire got going. The building owner is the first suspect in the case and he has a criminal family background and criminal record, but his alibi checks out.
The victim turns out to be Blake McCann, the investigating officer of the fire department. McCann was trying to capture a serial arsonist and was on his trail before he was murdered. Beckett asks McCann's partner to give all the files related to the case to her department. The name of Adam Ferguson pops-up from those files. McCann had put Ferguson in prison on multiple arson accounts. He had got out of the prison five years ago. The serial arson attack started around that time.
Ferguson, however, says to Beckett that McCann had called him to know about the serial arsonist, and that he has nothing to do with his murder. He calls the serial arsonist an artist and goes about planning and implementing the arson plan like an artist. It looks the arsonist must be present at the site to watch the building crumble because of his fire act.
Ryan and Esposito go inside a shoe factory to investigate it, while Castle and Beckett knock at the doors of Milo Pavlik. He owns the site Pyrolicious.com, which is a website targeted at fire enthusiasts. The site has the video of the latest arson attack. Pavlik tells Beckett and Castle that someone dropped the USB drive in his drop-box kept outside. The USB contained the high quality video of the arson attack. Pavlik says that he just uploaded the video on his site and has nothing to do with the attack.
Pavlik gets text on his cell phone about the blaze at the shoe factory. Castle and Beckett rush to the spot, realising that Ryan and Esposito were investigating the same factory. They had gone inside it. The fire department people tell Beckett and Castle that the chance of someone coming out alive from the burning factory is bleak. Jenny too reaches the spot and is experiencing labour contraction, but she refuses to leave the place without Ryan.
Inside the factory, Ryan and Esposito had found a room equipped with all the devices to start the fire. The room had looked like headquarter of the arsonist. An alarm had gone off in that room and soon the whole building was embraced by fire. The blow of the arson attack had made Ryan and Esposito unconscious.
First Esposito and then Ryan open their eyes. A pillar has fallen on Ryan's leg and Esposito, with much difficulty and effort, manages to free his partner's leg. Their cell phones are useless. Ryan temporarily fixes a factory phone line and contacts Beckett. He tells her about their location inside the factory. Ryan also talks to Jenny and tells her to name their child Javier if it is a boy and Sarah Grace, if it is a girl.
The Fire department people are unable to find the room where Ryan and Esposito are trapped in the factory blueprint. At the 12th precinct, Captain Gates is following the case. She grills Pavlik when it is discovered that a person with the ID Firebug 477 had checked only serial arsonist videos, a few moments after they were uploaded on the website. Pavlik confesses to having chatted with the person a couple of times on IM. The person had told him that he is putting to rest the buildings that are damaged and have defects.
McCann's partner confirms that the buildings that were attacked had some problem. The only who would knew for sure is the person who signed on that information, the building inspector. Mark Kimball is the building inspector who had signed on each of those reports. Beckett gives a look at the man's photograph and correctly deduces that he is there at the spot. Kimball is caught filming the burning factory.
They cough out of the information from him how to get inside where Ryan and Esposito are trapped. Ryan and Esposito come out alive. Ryan sees his new born daughter, Sarah Grace.