The it refers to the sun or the sun's rays. Contextually this is apparent as the sun's rays immediately precede the use of it and the sun is the most likely subject to shine. This makes sense if you substitute in sun or sun's rays into the sentence.
..no atmosphere to filter sun's rays when the sun is shining...
..no atmosphere to filter sun's rays when the sun's rays are shining...
The object blanket is referring to can be a bit harder to parse. The object is atmosphere, which I will demonstrate by reducing the sentence down as such:
This occurs because there is no atmosphere to filter [X] and then to blanket [Y].
The [X] is part of describing the condition of the filtering. Blanket is a separate term. You can verify this by removing the "filter" clause and checking the resulting sentence.
This occurs because there is no atmosphere to blanket in warm air when the sun goes down.