  An analysis is provided of the degradation that arises in the quality factor
of a whispering gallery mode when a circular or spherical dielectric cavity is
deformed. The large quality factors of such resonators are important to their
use in applications such as sensors, wavelength filters or lasers. Yet a
straightforward analysis of the effect of shape deformation on quality factors
cannot given because the underlying complex ray data demanded by a standard
eikonal approximation frequently does not exist. In this paper we exploit an
approach that has been successfully used elsewhere to describe the strong
directional emission of such systems, based on a perturbative treatment of the
relevant complex ray families. Applicable when the radial perturbation is
formally of the order of a wavelength, the resulting approximation successfully
describes changes to the quality factor using the ray geometry in a
neighbourhood of a discrete set of escaping rays guiding the directions of
maximum emitted intensity.
