it would seem that there is a problem with the safety valve. in order for the gass to stay lit there is a heat operated valve which keeps the gas on when hot and switches off when cold.
this might not be opperating due to many reasons. but have a tinker and im sure you figure it out. maybe try cleaning the area well fist and make sure that the thermocouple which is attached to the valve is close to the pilot light.
pete
June 2008