  Let $X$ be a smooth projective curve of genus $g\geq 2$ over the complex
numbers. Fix $n\geq 2$, and an integer $d$. A pair $(E,\phi)$ over $X$ consists
of an algebraic vector bundle $E$ of rank $n$ and degree $d$ over $X$ and a
section $\phi$. There is a concept of stability for pairs which depends on a
real parameter $\tau$. Let $M_\tau(n,d)$ be the moduli space of
$\tau$-semistable pairs of rank $n$ and degree $d$ over $X$. We prove that the
cohomology groups of $M_\tau(n,d)$ are Hodge structures isomorphic to direct
summands of tensor products of the Hodge structure $H^1(X)$. This implies a
similar result for the moduli spaces of stable vector bundles over $X$.
