A mercury barometer consists of a column of mercury suspended with its open end in a basin of mercury.
The pressure at a depth in a liquid is given by
P0+ρgh where
P0 is the pressure at the surface,
ρ is the density of the liquid, and
h is the depth from the surface of the water.
Above the mercury column is vacuum, hence
P0=0 The pressure at the point where the column meets the surface will be
P=ρgh.
Since fluids have a property that points at the same level in the same fluid have the same pressure, we get the relation that atmospheric pressure acting in the surface of mercury in the basin =
ρgh