See the Math Inverse Square Law

The inverse square law describes how the brightness of an object appears to decrease with distance. The intensity, I, of light on the surface of a sphere of radius, r, with a point source of light at its center is:

inverse square gif

where L is the total power output (luminosity) of the light source. According to the inverse square law, the amount of light from a star or a supernova collected by a telescope decreases as the square of the telescope's distance from the object. Thus, an object twice as far away will appear four times less bright. This relation between brightness and distance allows astronomers to determine the distance to standard candles by measuring their brightness.