A new astronomical method for determining the brightness of the night sky and its application to study long-term changes in the level of light pollution