After reviewing the peculiar thermodynamics and statistical mechanics of self-gravitating systems, we consider the case of a "binary star" consisting of two particles of size a in gravitational interaction in a box of radius R. The caloric curve of this system displays a region of negative specific heat in the microcanonical ensemble, which is replaced by a first-order phase transition in the canonical ensemble. The free energy viewed as a thermodynamic potential exhibits two local minima that correspond to two metastable states separated by an unstable maximum forming a barrier of potential. By introducing a Langevin equation to model the interaction of the particles with the thermal bath, we study the random transitions of the system between a "dilute" state, where the particles are well separated, and a "condensed" state, where the particles are bound together. We show that the evolution of the system is given by a Fokker-Planck equation in energy space and that the lifetime of a metastable state is given by the Kramers formula involving the barrier of free energy. This is a particular case of the theory developed in a previous paper (Chavanis, 2005) for N Brownian particles in gravitational interaction associated with the canonical ensemble. In the case of a binary star (N=2), all the quantities can be calculated exactly analytically. We compare these results with those obtained in the mean field limit N→+∞.