On the theory of the chromosphere and the corona