We study the buildup of quantum coherence between two Bose-Einstein co
ndensates that are initially in mixed states. We consider in detail th
e two cases where each condensate is initially in a thermal or a Poiss
on distribution of atom number. Although initially there is no relativ
e phase between the condensates, a sequence of spatial atom detections
produces an interference pattern with arbitrary but fixed relative ph
ase. The visibility of this interference pattern is close to one for t
he Poisson distribution of two condensates with equal counting rates b
ut it becomes a stochastic variable in the thermal case, where the vis
ibility will vary from run to run around an average visibility of pi/4
. In both cases, the variance of the phase distribution is inversely p
roportional to the number of atom detections in the regime where this
number is large compared to one but small compared with the total mean
number of atoms in the condensates. [S1050-2947(97)06812-1].