THERMISTOR
As the temperature increases, the resistance in the thermistor decreases. It is a definiton, as thermistor is made up of semi-conductors.
The lower part of the circuit gets more share of the resistance (note that this part must NOT be connected to a transistor), more current can then flow through it, thus switching on the lamp.
LDR
As the light intensity decreases, the resistance increases.
The part of the circuit with the LDR gets more share of the resistance (note that this part must be connected to a transistor), more current can then flow through it, thus switching on the lamp.