  One of the big challenges in exoplanet science is to determine the
atmospheric makeup of extrasolar planets, and to find biosignatures that hint
at the existence of biochemical processes on another world. The biomarkers we
are trying to detect are gases in the exoplanet atmosphere like oxygen or
methane, which have deep absorption features in the visible and near-infrared
spectrum. Here we establish the ultimate quantum limit for determining the
presence or absence of a spectral absorption line, for a dim source in the
presence of a much brighter stellar source. We characterise the associated
error exponent in both the frameworks of symmetric and asymmetric hypothesis
testing. We found that a structured measurement based on spatial demultiplexing
allows us to decouple the light coming from the planet and achieve the ultimate
quantum limits. If the planet has intensity $\epsilon \ll 1$ relative to the
star, we show that this approach significantly outperforms direct spectroscopy
yielding an improvement of the error exponent by a factor $1/\epsilon$. We find
the optimal measurement, which is a combination of interferometric techniques
and spectrum analysis.
