Attack the Machines
Pick up any of the boxes/crates which litter the area during the fight. Because Doc Ock can't be hit immediately, you have to attack the fire-spitting machines in front of him first. Once you have a box, throw it at one of the machines. Hitting one of the machines three times will get Doc Ock to jump down and try to fix it.
Attacking Doc Ock
Jump to dodge Doc Ock's initial blast attack when he comes down to fix the machine. You will get a feel for the rhythm of this once you have dodged one or two of his attacks. Attack him as he is fixing the machine.
Distance Attacking
Pick up another box after throwing the third one at one of the machines. Once you dodge his blast attack, throw the box at him to cause damage without getting close enough for him to hurt you. Repeat until he is defeated.