After being reunited with his estranged sister Jeannie a year ago (McKay and Mrs. Miller), Rodney has been keeping up a correspondence with her back on Earth. Unfortunately, certain powerful people are aware of this, and they use it to lure Jeannie into a trap. Rodney goes looking for her, and the two find themselves captives.
Rodney wakes up in a laboratory on Earth with Jeannie, and the two meet the man behind all of this, Henry Wallace, the president of Devlin Medical Technologies. His company gets a lot of government contracts, and is one of their primary resources for integrating alien technologies acquired by the Stargate Program into Earth's medical technology. Wallace therefore has only the lowest level of access to information, but after a few too many astounding break-throughs by the military, he has managed to find out all about the S.G.C., Atlantis, and ...Rodney McKay.
Soon Wallace shows the two brilliant scientists why he's brought them here; his daughter Sharon is suffering from leukemia. McKay isn't sure what he wants the two of them to do as neither are medical doctors. Wallace explains that Sharon has been given prototype nanites to try and heal her, but they are doing more harm than good. She is dying. He is willing to do so much to save her because his wife died three years before and she's all he has left. Rodney and Jeannie are experts on their coding but the problems haven't been worked out yet.
The rest of the Atlantis team, of course, won't take Rodney's disappearance lying down. Sheppard and Ronon visit Earth, where they work with Stargate Command and N.I.D. Agent Malcolm Barrett to try and find their missing people.
Back in the lab, Jeannie is infected with the malfunctioning nanites in order to provide more of an incentive for her and McKay to finish their program. Suddenly, without warning, Sharon's heart stops. Everybody believes she has died until her heart suddenly restarts, much to everybody's surprise. After further analysis, McKay and Jeannie discover that Sharon had a heart condition that was separate from her leukemia. The nanites detected the condition and shut down her heart to repair the damage. Unfortunately, because the nanites were only programmed to repair damage and not to be concerned about the patient, they shut down Sharon's heart without regard to the lack of oxygen reaching her brain. The nanites have effectively put Sharon into a vegetative state. McKay and Jeannie realize in horror that the nanites will soon try to cure Jeannie's epilepsy, most likely killing her in the process. However, before they can do anything about it, Sheppard and Ronon arrive and arrest Wallace.
Back at the SGC, McKay attempts to fix the nanites' programming. As he works, Sharon eventually dies when the nanites run out of power before fully repairing her body, putting more pressure on him succeeding. Unfortunately, McKay knows he cannot finish the code in time, and resorts to using their captive Wraith to help. He manages to convince the Wraith that it is in his best interest to help reprogram the nanites, since it would be a stepping stone to destroying the Replicators. The Wraith agrees, but is too weak from starvation to finish the code. McKay offers to sacrifice himself to feed the Wraith so he can complete the code, but Sheppard has different ideas. He approaches Wallace, telling him that Sharon has died and that Jeannie will soon be next, leaving behind her husband and daughter. He also tells Wallace about the Wraith and the fact that it needs to feed. The distraught Wallace is wracked with guilt and regret and agrees to sacrifice himself. The Wraith, now nourished, finishes the code and Jeannie is saved, much to McKay's relief.