The classical intermediate value theorem for polynomials with real coefficients is generalized to the case of polynomials with coefficients in a lattice-ordered ring that is a subdirect product of totally ordered rings. Several candidates for a generalization are investigated, and particular attention is paid to the case when the lattice-ordered ring is the algebra C(X) of continuous real-valued functions on a completely regular topological space X. For all but one of these generalizations, the intermediate value theorem holds only if X is an F-space in the sense of Gillman and Jerison. Surprisingly, for the most interesting of these generalizations, if X is compact, the intermediate value theorem holds only if X is an F-space and each component of X is an hereditarily indecomposable continuum. It is not known if there is an infinite compact connected space in which this version of the intermediate value theorem holds