In this paper we study the heat transfer in a turbulent channel flow, which is periodically heated through its walls. We consider the flow of air and water vapor using direct numerical simulation. We consider the fluid as a compressible Newtonian gas. We focus on the heat transfer properties of the system, e.g., the temperature difference between the walls and the Nusselt number. We consider the dependence of these quantities on the frequency of the applied heat flux. We observe that the mean temperature difference is quite insensitive to the frequency and that the amplitude of its oscillations is such that its value multiplied by the square root of frequency is approximately constant. Next we add droplets to the channel, which can undergo phase transitions. The heat transfer properties of the channel in the case with droplets are found to increase by more than a factor of two, compared to the situation without droplets.