Answer:
As material in a liquid phase increases his temperature over a given value, it starts to change is a phase, from liquid to gas phase.
Now, the water in the glass is in the liquid phase, and as the sunlight impacts, it starts to raise up the temperature of the water.
Now, this change of phase depends on the pressure of the material (less pressure needs less heat to change of phase), this means that the water that is directly in the "top" (that is only experiencing the atmospheric pressure) will start to evaporate slowly.
Then the process is the next:
Liquid water in the glass:
The sunlight transmits some heat tho the liquid water in the glass:
When the heat reaches a given point, some of the liquid water changes of phase to a more chaotic one, the gas phase (vapor of water)