  In the smallest cases where there exist nonnegative polynomials that are not
sums of squares we present a complete explanation of this distinction. The
fundamental reason that the cone of sums of squares is strictly contained in
the cone of nonnegative polynomials is that polynomials of degree $d$ satisfy
certain linear relations, known as the Cayley-Bacharach relations, which are
not satisfied by polynomials of full degree 2d. For any nonnegative polynomial
that is not a sum of squares we can write down a linear inequality coming from
a Cayley-Bacharach relation that certifies this fact. We also characterize
strictly positive sums of squares that lie on the boundary of the cone of sums
of squares and extreme rays of the cone dual to the cone of sums of squares
