Theory of radiative transfer in planetary atmospheres