Let
T
=
∫
Z
⊕
T
(
E
)
T = \smallint _Z^ \oplus T(\mathcal {E})
be a direct integral of Hilbert space operators, and equip the collection
C
\mathcal {C}
of compact subsets of C with the Hausdorff metric topology. Consider the [set-valued] function sp which associates with each
E
∈
Z
\mathcal {E} \in Z
the spectrum of
T
(
E
)
T(\mathcal {E})
. The main theorem of this paper states that sp is measurable. The relationship between
σ
(
T
)
\sigma (T)
and
{
σ
(
T
(
E
)
)
}
\{ \sigma (T(\mathcal {E}))\}
is also examined, and the results applied to the hyperinvariant subspace problem. In particular, it is proved that if
σ
(
T
(
E
)
)
\sigma (T(\mathcal {E}))
consists entirely of point spectrum for each
E
∈
Z
\mathcal {E} \in Z
, then either T is a scalar multiple of the identity or T has a hyperinvariant subspace; this generalizes a theorem due to T. Hoover.