Cows moo when they are scared or sense that something is wrong. Mothers and calves call to each other if separated. Hungry calves will call to attract the attention of their mothers. Cows also vocalize when they are coming into heat, presumably to attract the attention of a bull.
The Merck Veterinary Manual says that very little is known about the vocal communication system of cattle. In addition to mooing, cattle can hoot and roar. Aggressive bulls roar as a warning of an imminent attack.
Most research on cow vocalizations assumes cattle only vocalize when distressed and use the rate of vocalization as a way to measure cattle distress.