We give a new construction of the Bott-Samelson variety $Z$ as the closure of a $B$-orbit in a product of flag varieties $(G/B)^l$. This also gives an embedding of the projective coordinate ring of the variety into the function ring of a Borel subgroup: $\CC[Z] \subset \CC[B]$. In the case of the general linear group $G = GL(n)$, this identifies $Z$ as a configuration variety of multiple flags subject to certain inclusion conditions, closely related to the the matrix factorizations of Berenstein, Fomin and Zelevinsky. As an application, we give a geometric proof of the theorem of Kraskiewicz and Pragacz that Schubert polynomials are characters of Schubert modules. Our work leads on the one hand to a Demazure character formula for Schubert polynomials and other generalized Schur functions, and on the other hand to a Standard Monomial Theory for Bott-Samelson varieties.