  We consider the problem of diagonalization of the hamiltonians of the Gaudin
model, which is a quantum chain model associated to a simple Lie algebra. The
hamiltonians of this model act on the tensor product of finite-dimensional
representations of this Lie algebra. We show that the eigenvalues of the Gaudin
hamiltonians are encoded by the so-called "opers" on the projective line,
associated to the Langlands dual Lie algebra. These opers have regular
singularities at the marked points with prescribed residues and trivial
monodromy representation.
  The Bethe Ansatz is a procedure to construct explicitly the eigenvectors of
the generalized Gaudin hamiltonians. We show that each solution of the Bethe
Ansatz equations defines what we call a "Miura oper" on the projective line.
Moreover, we show that the space of Miura opers is a union of copies of the
flag manifold (of the dual group), one for each oper. This allows us to prove
that all solutions of the Bethe Ansatz equations, corresponding to a fixed
oper, are in one-to-one correspondence with the points of an open dense subset
of the flag manifold.
  The Bethe Ansatz equations can be written for an arbitrary Kac-Moody algebra,
and we prove an analogue of the last result in this more general setting.
  For the Lie algebras of types A,B,C similar results were obtained by other
methods by I.Scherbak and A.Varchenko and by E.Mukhin and A.Varchenko.
