The trick is to fill it with sand before heating the plastic and bending it. Normally, the pipe would pinch closed in areas where it is bent, but the sand prevents that. When the heat forming is finished, you just drain out the sand.
Step 1: Safety While Heating PVC
Vinyl Chloride, one of the components of PVC, is carcinogenic. When it is locked up in the polymer, however, it is much safer to be around. In my years of experience working with PVC, I have not noticed any adverse effects on my health from being around it.
Always work in areas with good ventilation. If you do get caught in a cloud of smoke, hold your breath and move to clean air.
When heating PVC with a gas stove or propane torch, try not to let it burn. Smoke from burning PVC is bad. With experience one burns it less and less. Don't panic the first time you do burn some. It scorches, but doesn't immediately burst into flame. Move the material away from the flame and try again. Don't breathe the smoke. Smoke avoidance comes naturally for most people.
While heating PVC over a gas flame, keep the plastic an appropriate distance from the flame to avoid scorching the surface before the inside can warm up. It takes time for heat to travel to the center of the material being heated.
Keep the plastic moving, and keep an eye on the state of the plastic. When heated, the PVC material is flexible, like leather. Beyond this stage, you risk scorching it.
A word from James, the plastic engineer -- "Just a word of warning, PVC can handle some high heats but if it catches fire, you wont be able to put it out, it does not need oxygen to burn so don't do this inside".
I do work inside, but my house is made of cement and has good ventilation. MAKE SURE THAT YOU HAVE GOOD VENTILATION. PLAY WITH FIRE -- CAREFULLY.
Step 2: Fill the Pipe With Sand
Step 3: Heating and Bending
Hold the pipe from both ends. Keep the pipe moving back and forth over the flame, rotating the pipe all the while so that the area to be bent is evenly heated.
Keep the pipe at a reasonable distance from the flame to keep from burning it. Heat penetrates slowly through the plastic. Be patient. Haste can result in burnt plastic. Don't try to heat it too fast.
When the plastic softens up some, the pipe begins to sag from its own weight and the weight of the sand inside it. It gets leathery.
At this point, turn off the stove and bend the pipe into the shape you want. Do it on the floor, if you want to keep it all in one plane.