  We discuss the stability theory and numerical analysis of the Helmholtz
equation with variable and possibly non-smooth or oscillatory coefficients.
Using the unique continuation principle and the Fredholm alternative, we first
give an existence-uniqueness result for this problem, which holds under rather
general conditions on the coefficients and on the domain. Under additional
assumptions, we derive estimates for the stability constant (i.e., the norm of
the solution operator) in terms of the data (i.e. PDE coefficients and
frequency), and we apply these estimates to obtain a new finite element error
analysis for the Helmholtz equation which is valid at high frequency and with
variable wave speed. The central role played by the stability constant in this
theory leads us to investigate its behaviour with respect to coefficient
variation in detail. We give, via a 1D analysis, an a priori bound with
stability constant growing exponentially in the variance of the coefficients
(wave speed and/or diffusion coefficient). Then, by means a family of analytic
examples (supplemented by numerical experiments), we show that this estimate is
sharp
