  The standard multidetector F-statistic for continuous gravitational waves is
susceptible to false alarms from instrumental artifacts, for example
monochromatic sinusoidal disturbances ('lines'). This vulnerability to line
artifacts arises because the F-statistic compares the signal hypothesis to a
Gaussian-noise hypothesis, and hence is triggered by anything that resembles
the signal hypothesis more than Gaussian noise. Various ad-hoc veto methods to
deal with such line artifacts have been proposed and used in the past. Here we
develop a Bayesian framework that includes an explicit alternative hypothesis
to model disturbed data. We introduce a simple line model that defines lines as
signal candidates appearing only in one detector. This allows us to explicitly
compute the odds between the signal hypothesis and an extended noise
hypothesis, resulting in a new detection statistic that is more robust to
instrumental artifacts. We present and discuss results from Monte-Carlo tests
on both simulated data and on detector data from the fifth LIGO science run. We
find that the line-robust statistic retains the detection power of the standard
F-statistic in Gaussian noise. In the presence of line artifacts it is more
sensitive, even compared to the popular F-statistic consistency veto, over
which it improves by as much as a factor of two in detectable signal strength.
