The energy is reflected from the cavity.  

In general, an optical cavity acts as a variable transmissivity mirror for a light source with very narrow linewidth (a laser).  As you change the length, the cavity can go between highly transmissive and highly reflective.  The specifics of how tranmissive and how reflective it can be depend on the reflectivity of the mirrors which make up the cavity.  In the particular case of a two mirror cavity with equal reflectivity mirrors, the transmissivity is shown below for two different values of finesse.

$\hspace{120px}$[![enter image description here][1]][2]


  [1]: http://i.stack.imgur.com/aIY3Z.png
  [2]: http://en.wikipedia.org/wiki/File:Etalon-2.png