How do we measure the brightness of the stars? How do scientists measure the brightness of so distant stars?
The term brightness, or apparent brightness, is used to describe how bright a star appears to us from Earth. The term luminosity is used to describe how bright the star is physically, also called intrinsic brightness. 

As light spreads from a star to the viewer, it diverges inversely proportional to the square of its distance (d) from the viewer.  $\begin{equation}B \propto \frac{1}{d^2}
\end{equation}$. 

The relationship between brightness (B) and luminosity (L) is described by $\begin{equation}B = \frac{L}{4\pi d^2}
\end{equation}$ (1). So we have three variables, brightness, luminosity and distance. 

So out of those three, you'd need two to acquire the third. The distance is generally the hardest to acquire. The gold standard in measuring the distance to a star is stellar parallax. If you can't do parallax, then distance-independent properties of stars sometimes serve as clues to distance. 

Measuring brightness is generally the easy one. CCD's are often used to measure apparent brightnesses. Brightness can be expressed in stellar magnitudes or absolute fluxes. 

So to sum up, we calculate or measure distance, we measure apparent brightness and finally calculate the luminosity value from (1).