The temperature gets warmer as you go upward in the stratosphere. Earth's "sunscreen", the ozone layer, is within the stratosphere. Ozone molecules absorb energy from ultraviolet "light" coming from the Sun. They turn that energy into heat. That is what heats the stratosphere.