  A line bundle on a smooth curve $C$ with two marked points determines a rank
function $r(a,b) = h^0(C, L(-ap-bq))$. This paper studies Brill-Noether
degeneracy loci; such a locus is defined to be the closure in $\Pic^d(C)$ of
the locus of line bundles with a specified rank function. These loci generalize
the classical Brill-Noether loci $W^r_d(C)$; for general $(C,p,q)$ we determine
the dimension, singular locus, and intersection class of Brill-Noether
degeneracy loci, generalizing classical results about $W^r_d(C)$. The
intersection class has a combinatorial interpretation in terms of the number of
reduced words for a permutation associated to the rank function, or
alternatively the number of saturated chains in the Bruhat order. The essential
tool is a versality theorem for a certain pair of flags on $\Pic^d(C)$,
conjectured by Melody Chan and the author. We prove this versality theorem by
showing the injectivity of a generalized Petri map, along the lines of Eisenbud
and Harris's proof of the Gieseker-Petri theorem.
