We prove a detailed sums of squares formula for two variable polynomials with
no zeros on the bidisk $\mathbb{D}^2$ extending previous versions of such a
formula due to Cole-Wermer and Geronimo-Woerdeman. The formula is related to
the Christoffel-Darboux formula for orthogonal polynomials on the unit circle,
but the extension to two variables involves issues of uniqueness in the formula
and the study of ideals of two variable orthogonal polynomials with respect to
a positive Borel measure on the torus which may have infinite mass. We present
applications to two variable Fej\'er-Riesz factorizations, analytic extension
theorems for a class of bordered curves called distinguished varieties, and
Pick interpolation on the bidisk.