Walk close to the portal on the floor nearby, then look up at the distant ceiling. There is a white part of the ceiling. Put a portal up there, then a portal of the other color on that white floor near you. Drop in.
Up ahead you'll see some corrupted cores, and GLaDOS will tell you that she'll send the cores to you so you can attach them to Wheatley. Once he becomes corrupted enough, it will be possible to do a core transfer.
Follow the walkway to the room at the end. GLaDOS asks you to put her into the machine so she can take you up. Press the interaction button to put her there.
Up in the lair, Wheatley will tell you his plan. You have four minutes before the facility self-destructs, during which time he'll throw bombs at you, all while filling the room with neurotoxin. And there are no portal surfaces.
Stand behind the white conversion gel tube. A bomb will be thrown at you, breaking open the conversion gel tube.
Now that there is conversion gel everywhere, stand on a white spot and put a portal under you (or slightly in front of you), then when Wheatley throws some bombs your way, put a portal on one of the angled walls up above that is pointed toward Wheatley. The bombs will hit him.
Now GLaDOS will send a corrupted core, the space core, to the upper catwalk. Put a portal on the angled wall up there, then put a portal of the other color directly below you. Once you fall through and end up on the catwalk, go over to the corrupted core, pick it up, then you will fall and a bunch of blue gel will splash everywhere. Use the blue gel to bounce up toward Wheatley's borrowed body and put the core on the red flashing spot.
When Wheatley wakes up, he'll start bombing you again. Put a portal slightly in front of you, then the other portal directly under Wheatley. The bombs that go toward you should end up going through the portal instead and going through the portal under Wheatley to hit him.
Now GLaDOS delivers the adventure sphere. To grab it, you have to go on the upper catwalk again like before, but this time bounce off of the blue gel below in order to reach the green sphere. You have to fall from the catwalk in order to bounce high enough. Take the adventure sphere to the red flashing spot on Wheatley. Use the blue gel to bounce up to the red spot and put the adventure sphere there.
Now when Wheatley throws bombs at you, his only exposed area is his back. So put a portal on the white wall up where the catwalk is, and position yourself such that Wheatley is between you and that catwalk portal. Then put a portal slightly in front of you so Wheatley throws bombs into it. They should hit him from behind.
The purple sphere, a.k.a. the Fact Sphere, is way up above. When it appears, some orange gel will coat the floor. Put a portal on the wall at the end of the orange gel, and put a portal of the other color on the floor under the purple sphere. Run across the orange gel into the portal and grab the sphere when you go through.
Jump on the blue gel near Wheatley to put the purple sphere in place.
Now the automatic system will want to initiate the core transfer. A sprinkler system will put out the fires, also washing away most of the gel. Put a portal on the white floor under Wheatley, then go over to the stalemate button and put a portal of the other color on the ceiling. Go back to the portal that you put in the white floor under Wheatley and drop in.
It's a trap! You'll fall to the floor and look over at Wheatley, then you'll look up at the ceiling, which collapses and reveals what is probably your first glimpse of the outside world in who knows how long. Up there you see the moon.
Reminds you of the old moon rocks that Cave Johnson ground up and turned into conversion gel, fatally poisoning himself in the process. Ah, memories.
But wait. Moon rocks can be turned into conversion gel... and you can make portals on conversion gel... So...
Look at the portal under Wheatley if you forgot what color it was. Then make a portal of the other color on the moon! Then just sit back and watch. Congratulations!