For hyperbolic Riemann surfaces of finite geometry, we study Selbergs zeta function and its relation to the relative scattering phase and the resonances of the Laplacian. As an application we show that the conjugacy class of a finitely generated, torsion-free, discrete subgroup of SL(2,R) is determined by its trace spectrum up to finitely many possibilities, thus generalizing results of McKean and Mueller to groups which are not necessarily cofinite.