Flux and the Inverse square law
Flux is the amount of power going through a unit area.
This diminishes with the square of the distance.
where L is the Luminosity and r is the distance to the star.
So the amount of flux decreases with the square of the distance.
Let us look at a practical example
If someone takes two torches, say one of 20 Watt and the other one of 10 Watt and walks to a distance of say 50 m, then we will see the bright torch still brighter than the less bright one, but both are less bright than at a closer distance.
If you now leave the one of 10 Watt at that distance and walk further say to 100 m with the one of 20 Watt. That more luminous one may now look fainter than the less luminous one that is still at a distance of 50 m.
This shows that if we do not know the actual luminosity of an object (say a star), the brightness (or flux) that we see does not tell us anything about the distance of the star. Brighter stars can be further away than fainter ones or the other way around. We cannot know.
Inverse Square Law
We saw that the flux decreases with the square of the distance. This means that if the distance increases by a factor of two, the flux diminishes by a factor of two-squared or four. If the distance is tripled, the flux decreases with a factor of nine, etc.
This relationship is well known in Physics and is called the Inverse Square Law.
The flux is an indicator for the brightness that we see.
So how can we find the distance to a star with the brightness that we observe?
The method of finding distance we are going to discuss is based on assumptions about the luminosity of the star. Suppose we know the luminosity (L in the image), then with the Flux (brightness that we observe) we are able to calculate the distance with the inverse square law.
In astronomy it is common to express brightness not in Flux but in Magnitude.