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.