The important thing to remember, which will help you understand everything else, is that voltage is measured with respect to another point.
In this (and almost every) case it is measured with respect to ground. So when you say the voltage at point X is Y volts you are actually saying that the difference in voltage between point X and GND is Y volts.
So on your schematic A0 measures the difference in voltage between it's IO pin (the junction between the 10KΩ resistor and the LDR) and ground. And looking at it, what is between its IO pin and ground? The 10KΩ resistor. So it is actually the voltage across that resistor that you are measuring.
Doing the sums:
Assume there is enough light falling on the LDR to make it have a resistance of 5KΩ. Current flows through both the LDR and the 10KΩ resistor in series, so it has a total resistance of (10,000 + 5,000) 15KΩ. With 5V across the whole lot (5V -> LDR -> 10KΩ -> GND) you get:
I = V/R = 5/15,000 = 0.000333... or 333µA.
333µA flowing through 10KΩ drops how much voltage?
V=RI = 10,000 × 0.000333... = 3.333...V
So A0 would be measuring 3.333V at that point.
Now, you turn out the lights, and the resistance of the LDR rises to, say, 50KΩ. What happens to those sums now? Well, let's look:
Total resistance = 50,000 + 10,000 = 60,000Ω
I=V/R = 5/60,000 = 0.00008333...
V=RI = 10,000 × 0.00008333... = 0.8333...V
The formulae can be simplified into just the ratio of the two resistances:
Vout = --------- × Vin
R1 + R2
So that is, with the lights on:
Vout = --------- × 5 = 0.666... × 5 = 3.333...
And with the lights on:
Vout = --------- × 5 = 0.1666... × 5 = 0.8333...
From that measured voltage, of course, you can then calculate what the resistance of the LDR must have been at the time. Rearranged the formula looks like:
R2 × Vin
R1 = ---------- - R2
Plug in the numbers for the voltage with the lights on:
10,000 × 5 50,000
R1 = ------------ - 10,000 = -------- - 10,000 = 5,000Ω
The kind of circuit is known as a Voltage Divider or Potential Divider and you can read more about them here: https://en.wikipedia.org/wiki/Voltage_divider