  We review various aspects of representation theory of affine algebras at the
critical level, geometric Langlands correspondence, and Bethe ansatz in the
Gaudin models. Geometric Langlands correspondence relates D-modules on the
moduli space of G-bundles on a complex curve X and flat G^L-bundles on X.
Beilinson and Drinfeld construct it by applying a localization functor to
representations of affine algebras of critical level. We show that in genus
zero the corresponding D-modules are closely related to the diagonalization
problem in the Gaudin model associated to G. This allows us to give a new
interpretation of the Bethe ansatz and Sklyanin's separation of variables in
the Gaudin model in terms of Langlands correspondence.
