  Aims: We analyse a long XMM-Newton spectrum of the narrow-line Seyfert 1
galaxy Mrk 766, using the marked spectral variability on timescales >20ks to
separate components in the X-ray spectrum. Methods: Principal components
analysis is used to identify distinct emission components in the X-ray
spectrum, possible alternative physical models for those components are then
compared statistically. Results: The source spectral variability is
well-explained by additive variations, with smaller extra contributions most
likely arising from variable absorption. The principal varying component,
eigenvector one, is found to have a steep (photon index 2.4) power-law shape,
affected by a low column of ionised absorption that leads to the appearance of
a soft excess. Eigenvector one varies by a factor 10 in amplitude on
time-scales of days and appears to have broad ionised Fe K-alpha emission
associated with it: the width of the ionised line is consistent with an origin
at about 100 gravitational radii. There is also a strong component of
near-constant emission that dominates in the low state, whose spectrum is
extremely hard above 1 keV, with a soft excess at lower energies, and with a
strong edge at Fe K but remarkably little Fe K-alpha emission. Although this
component may be explained as relativistically-blurred reflection from the
inner accretion disc, we suggest that its spectrum and lack of variability may
alternatively be explained as either (i) ionised reflection from an extended
region, possibly a disc wind, or (ii) a signature of absorption by a disc wind
with a variable covering fraction. Absorption features in the low state may
indicate the presence of an outflow.
