Brightness dependent texture on mesh
No, it's not possible to do this in Cycles, it will first evaluate the material nodes entirely, and then compute the lighting.

Supporting this would be incompatible with progressive rendering and bidirectional lighting algorithms, and so physically based render engines usually can't do this.

For the earth example, a workaround would be to use a Normal node Dot output, with the Geometry node Normal output plugged into the Normal input. If you then set the direction to match the sun light it will give you a factor than can be used for blending.