  We extend bar-cobar duality, defined for operads of chain complexes by
Getzler and Jones, to operads of spectra in the sense of stable homotopy
theory. Our main result is the existence of a Quillen equivalence between the
category of reduced operads of spectra (with the projective model structure)
and a new model for the homotopy theory of cooperads of spectra. The crucial
construction is of a weak equivalence of operads between the Boardman-Vogt
W-construction for an operad P, and the cobar-bar construction on P. This weak
equivalence generalizes a theorem of Berger and Moerdijk that says the W- and
cobar-bar constructions are isomorphic for operads of chain complexes. Our
model for the homotopy theory of cooperads is based on `pre-cooperads'. These
can be viewed as cooperads in which the structure maps are zigzags of maps of
spectra that satisfy coherence conditions. Our model structure on pre-cooperads
is such that every object is weakly equivalent to an actual cooperad, and weak
equivalences between cooperads are detected in the underlying symmetric
sequences. We also interpret our results in terms of a `derived Koszul dual'
for operads of spectra, which is analogous to the Ginzburg-Kapranov dg-dual. We
show that the `double derived Koszul dual' of an operad P is equivalent to P
(under some finiteness hypotheses) and that the derived Koszul construction
preserves homotopy colimits, finite homotopy limits and derived mapping spaces
for operads.
