Moon ) ======s=u=n=l=i=g=h=t====== ☼ Sun
You (^: looking up from
-^-^-^-~~ the Earth
Looking at the part of the Moon that is illuminated, you can deduce the general direction of the source of illumination, the Sun. But to infer from this the Sun's actual location you need to realise that in relation to the Moon, the Sun is very far away, nearly four hundred times beyond the orbit of the Moon. So when you see a crescent moon that is apparently not far removed from the Sun in the sky, remember it is being illuminated almost from behind, from far beyond the Moon's orbit. In fact, with respect to the Sun, the Moon and Earth are never separated by more than a small fraction of one degree of arc. Therefore, it is the angle of the Moon (not its apparent proximity) to the Sun as seen from Earth that largely determines the degree of illumination we observe -
180° = 100%
90° = 50%
45° = 25%
18° = 10%
or about 5% for each 9° of separation.