Chris meets Phoebe at the newspaper; he is desperate, because a number of fortune-tellers and soothsayers have told him that he is to be conceived this month and he will cease to exist if this doesn't happen. Phoebe blames him for the separation of Leo and Piper, but Chris argues that he had to become the sisters' whitelighter to protect Wyatt. Phoebe picks up a letter to her column and gets a premonition of a woman being attacked by a demon.
Chris orbs Phoebe to a place in the Middle East, where they vanquish a demon and chase away another on a flying carpet. The one on the flying carpet drops a bottle; Phoebe dusts it off and a Genie emerges. She calls herself Jinny, and admits that she had written the letter to Ask Phoebe. Jinny tells Phoebe that her last master was Bosk who was "cruel even for a demon". Chris is upset because Piper is with Greg. As he orbs after Piper, Phoebe inadvertently makes her first wish to the genie, that Chris wouldn't go. Chris loses his power to orb. Phoebe uses her second wish to give his power back. Jinny tells Phoebe and Paige that Bosk is looking for Zanbar, a buried city of evil magic. Chris goes to Piper and tells her there's an emergency, separating her from Greg. Chris tries to separate Piper from Greg permanently, but won't tell her why.
Bosk flies through the attic window on his carpet. Phoebe throws a potion, but Bosk is wearing the Eye of Aghbar, which protects him. Phoebe wishes Jinny free and Jinny throws a fireball, vanquishing Bosk. Jinny flies away on Bosk's carpet. Phoebe finds that she is stuck in the bottle and that Chris, who had first picked up the bottle, is her master. Leo, later, reads the Arabic inscription on the bottle, which states that Jinny was a demon cursed to grant the wishes of others and that whoever freed Jinny, would be forced to switch places with her.
Leo tells Chris that he is to be sent back to his own time, that he has done more harm than good as a Whitelighter. An angry Chris then wishes Leo would get over being angry with him, which Phoebe grants.
Paige is at Richard's home and has summoned the ghosts of his family for a 'magical intervention', because she is worried about his use of magic. Richard, however, refuses to admit a problem and, angry at Paige for interfering, teleports out. Jinny takes control of Bosk's demon gang, who believe they have found Zanbar.
Chris urges Leo to get back together with Piper, but he is unwilling. Finally, Chris uses his second wish to get Piper and Leo to "sleep together". Phoebe tricks him, however, by forcing them to physically fall asleep next to each other. Two demons attack; Paige vanquishes them and Jinny follows. Paige catches Jinny in a crystal cage, but Richard grabs the bottle and shimmers away. Chris admits to Paige that he is Piper and Leo's son after creeping her out when he told her his second wish.
Back at Richard's house, Paige tries to throw a power-stripping potion at Richard, but he repels it and knocks Paige flat. At the manor, Chris shows Greg that Leo and Piper are asleep together and Greg leaves, disappointed. Richard, sorry for what he has done, wishes Phoebe free.
Jinny frees herself by summoning her carpet. Threatening the sleeping Leo and Piper, she orders Chris to take her to the bottle. He does so and Jinny gets the bottle, where in now, resides Richard, and wishes the Charmed Ones dead, then orders Richard into the bottle. Piper's ghost floats over her body, but Leo pulls her close, heals her in her sleep, causing her ghost to return to her body.
Phoebe and Paige were revealed not to have moved on, because the wish was for the Charmed Ones to die and, as Piper was healed, the others could not die. Piper and Leo orb out to get Wyatt, leaving Chris to wonder aloud, "What about me?".The ghosts of Phoebe and Paige stabilise (i.e. are stopped from moving on) and whisp to haunt Jinny as she wishes for the return of Zanbar. The city rises and the ghosts of Phoebe and Paige arrive with Chris. Phoebe possesses Jinny, uses her body to vanquish the demons and wishes Richard free. Richard wishes the Charmed Ones alive again. He gives Chris the bottle after wishing Zanbar to be hidden again.
Richard discussing his problems with magic with Paige and shows her that he has finally, reluctantly, taken the power-stripping potion. Leo and Piper awaken and Leo is given the bottle to get rid of. Piper thought, on awaking, that she was dreaming and tells Leo that he healed her in her sleep.