The p-star model or exponential random graph is among the oldest and best known of network models. Here we give an analytic solution for the particular case of the two-star model, which is one of the most fundamental of exponential random graphs. We derive expressions for a number of quantities of interest in the model and show that the degenerate region of the parameter space observed in computer simulations is a spontaneously symmetry-broken phase separated from the normal phase of the model by a conventional continuous phase transition.