The gas temperature in the surface layers of disks around pre-main sequence stars