This battle is fought in the Lamp Chamber, where Sora battles against both Jafar and Genie. Genie releases only minor attacks. If he manages to hit Sora, he releases a small amount of HP, MP, or Munny orbs at the same time, but use the time he apologizes to figure out where he is and so you can Dodge Roll out of the way or Guard.
Jafar's sorcery is the far greater threat. His main attack is a continuous beam of electricity from his snake staff's eyes, and he also uses fire magic to empower his staff, using it as a bludgeoning weapon. He can also cast a massive ice storm at the center of the chamber; if caught inside, dodge the hail and wait for the spell to dissipate. Jafar himself floats around the arena and, unless he is using his fire staff, floats away whenever he sees Sora getting close, making it difficult to hit him. Magic will damage him, but he will quickly seal himself inside a bubble that renders him immune to magic after taking a couple of hits. As well, if you hit him enough times in his physical form, he will turn into a glowing ball of smoke for a short time. This renders him unable to attack, but also immune to attacks.
The prize for winning this fight is an upgrade to Blizzara. After this, it would be wise to heal the party at the save point in the treasure room and head across the lamp chamber towards Jasmine and jump into the massive pit.
Kingdom Hearts II
Upon entering the Sandswept Ruins, Jafar's Shadow will appear, and Sora must chase him on the Carpet. Once Sora reaches him, he will summon a swarm of Heartless and fly away—simply defeat the Heartless and catch up to Jafar's Shadow again. Whenever it starts to cast Thunder, simply attack it with the Keyblade to cause it to stop and flee again. Jafar's Shadow will repeat this attack a few times, then it will open up a new part of the area which contains a tower.
Chase the shadow to the top of the tower and defeat a final wave of Heartless, and a monument will appear at the top of the tower. Examining it will cause it to display images of three magic switches around the area. Now locate and trigger the switches using the spell of the same color, and the door to the Ruined Chamber will open for a short period. Sora must enter the chamber before time runs out to end the battle.
Kingdom Hearts coded
Jafar is fought twice in this game; once after finding Jasmine and then again after reaching the Lamp Chamber in the Cave of Wonders.