Animals that forage socially often stand to gain from coordination of their behaviour. Yet it is not known how group members reach a consensus on the timing of foraging bouts. Here we demonstrate a simple process by which this may occur. We develop a state-dependent, dynamic game model of foraging by a pair of animals, in which each individual chooses between resting or foraging during a series of consecutive periods, so as to maximize its own individual chances of survival. We find that, if there is an advantage to foraging together, the equilibrium behaviour of both individuals becomes highly synchronized. As a result of this synchronization, differences in the energetic reserves of the two players spontaneously develop, leading them to adopt different behavioural roles. The individual with lower reserves emerges as the 'pace-maker' who determines when the pair should forage, providing a straightforward resolution to the problem of group coordination. Moreover, the strategy that gives rise to this behaviour can be implemented by a simple 'rule of thumb' that requires no detailed knowledge of the state of other individuals.