Beckett is rushed to the hospital after she was hit by a sniper. Lanie goes along in the ambulance, trying to save Beckett's life and Castle follows close behind. While Josh is not allowed to operate on trauma patients that he is actually close with, the time is of the essence. Once his replacement surgeon arrives at the hospital, he blames Castle for Beckett's injury. He says that Castle should never have pushed her into solving her own mother's murder and Castle believes that Josh does have a point. Once Beckett has been stabilized, Castle finds out that she doesn't remember anything about being shot which means she doesn't know that he told her that he loved her. Beckett tells him that she needs time to heal but never calls in the months that pass. When Beckett finally goes back to the office, Castle is gone.
The precinct has a new captain – Captain Victoria Gates. Her way of ruling by the book has everyone around the office calling her "Iron Gates" though she prefers everyone to address her as "Captain" or "Sir." One of her priorities after arriving at the precinct is getting rid of Castle. Beckett goes to Castle's book signing for his book Heat Rises. Castle is mad until he learns that Josh is no longer a part of the picture. Beckett tells him that she'll never be able to be part of a relationship that's true and honest until she puts her mother's murder behind her and Castle agrees to help her with that. With a little help from the mayor, he and Beckett are partners again.
They find a money trail that they trace back to a bank. This bank had suspiciously had its files destroyed in a fire. Before Captain Montgomery had been killed, he had mailed a package to a man full of evidence. Upon opening the package, the man calls officials in Congress at the capitol. Ryan and Esposito are able to catch celebrity Sonya Gilbert's murderer. Gilbert's boyfriend, Dale, had left the apartment after the murder had happened and the team is able to follow him to his rehearsal space. Dale pulls a gun and points it at Beckett but back up arrives in time to save her. No one notices that Beckett is shaking except for Castle.
Castle and Beckett find the fire inspector, Ron Halstead. They question him about why he wrote off the warehouse fire as an accident and after his explanation, Beckett still does not believe him and she lets him know this. Castle's concerns are piqued when the mysterious man who received the package tells him that he is friends with Montgomery. He also says that Beckett is safe but only if she stays away from the case. This has Castle worried but it has Alexis more worried for her father. She reminds him that he's a writer, not a cop.
The team does not believe that Dale shot Sonya Gilbert. They think that the shooter must have been in the apartment before Sonya and Dale had gotten home but waited long enough in order to frame Dale for the murder. The team also finds fingerprints that belong to Mitch, one of Dale's bandmate. They return to the band's rehearsal space where another gun is being pointed at Beckett. Castle is able to talk her through the situation and help her through her fear and Mitch drops the gun and Castle arrest him.
Castle has a talk with Alexis, explaining that he needs to be there for Beckett and he won't stop until he's able to find the sniper that shot Beckett. After all that's happened, Beckett decides to return to therapy. It turns out that she had lied about what she remembers. She remembers everything.