  The construction of the trace formula for open dielectric cavities is
examined in detail. Using the Krein formula it is shown that the sum over
cavity resonances can be written as a sum over classical periodic orbits for
the motion inside the cavity. The contribution of each periodic orbit is the
product of the two factors. The first is the same as in the standard trace
formula and the second is connected with the product of reflection coefficients
for all points of reflection with the cavity boundary. Two asymptotic terms of
the smooth resonance counting function related with the area and the perimeter
of the cavity are derived. The coefficient of the perimeter term differs from
the one for closed cavities due to unusual high-energy asymptotics of the
$\mathbf{S}$-matrix for the scattering on the cavity. Corrections to the
leading semi-classical formula are briefly discussed. Obtained formulas agree
well with numerical calculations for circular dielectric cavities.
