The lighting on any particular feature on the Moon depends predominately on the Colongitide at the time. The colongitude is defined as the longitude of the sunrise terminator measured westward from the prime meridian. (The prime meridian is the central meridian of the Earth-facing Moon when in its mean librational position and passes through the Sinus Medii.) This is slightly confusing as the longitude is also measured from the prime meridian but increases eastward. Were they measured in the same direction, the height of the Sun in the lunar sky would be the difference between the two. As it is one first has to convert one or the other into a scale running the other way.
As an example of the calculations involved, take the crater Theophilus which is at longitude 26.4° and let us suppose the colongitude is at 10°. At longitude -10° the Sun is rising, and Theophilus is 36.4 ° east of there, so the height of the Sun in the lunar sky will be 36.4°.
As a second example, take Copernicus which is at longitude 340° (or 20° west), and suppose the colongitude is 135°. The sun is rising at longitude -135° so at longitude -20° the Sun is at 115° from the east, or 180 - 115 = 65° above the western horizon. So the light is from the west with the Sun at 65°. You can look at it another way. If the colongitude is 135, then the sunset terminator is at 135 + 180 = 315° measured westward, or at longitude 360 - 315 = 45°. So the height of the Sun is 20 + 45 = 65°.
I should add that the above discussion ignores the effect of the solar angle. The Moon's axis of rotation is not at right angles to the plane of its orbit around the Sun, so the Sun in the lunar sky will move in a way similar to the way in moves in the skies of the Earth at different times of the year. The effect however is much smaller as the Moon's axis is inclined at only 1.6° from the perpendicular. This results in the poles sometimes being in sunlight, sometimes not (as on Earth). The effect obviously affects the height of the Sun in the lunar sky to a small extent.
On my lunar pages I quote the phase (or age) of the Moon in days. The phase is actually an angle and I have been criticised for measuring an angle in units of time. It seems illogical, but there is a good precedent in Astronomy as the Right Ascension is also an angle and is conventionally quoted in hours. Although the age of the Moon is conventionally equal to the time since New Moon, this correlates rather poorly with the appearence of the Moon as seen in the sky. The phase of the Moon gives a much better representation of the appearence but conventionally starts at Full Moon. The method of using the Sun-Earth-Moon angle seems to me to give the best of both worlds. It is zero at New Moon and relates well to the way the Moon appears in the sky. The difference between this measure of age and the conventional one is generally quite small so would not cause an observer to look on the wrong day, and the measure correlates well with colongitude apart from the effects of libration.