HANFORD, Calif.  Three years ago, a technological breakthrough gave dairy farmers the chance to bend a basic rule of nature: no longer would their cows have to give birth to equal numbers of female and male offspring. Instead, using a high-technology method to sort the sperm of dairy bulls, they could produce mostly female calves to be raised into profitable milk producers.

Now the first cows bred with that technology, tens of thousands of them, are entering milking herds across the country  and the timing could hardly be worse.

The dairy industry is in crisis, with prices so low that farmers are selling their milk below production cost. The industry is struggling to cut output. And yet the wave of excess cows is about to start dumping milk into a market that does not need it.

“It’s real simple,” said Tony De Groot, an early adopter of the new breeding technology, who milks 4,200 cows on a farm here in the heart of this state’s struggling dairy region. “We’ve just got too many cattle on hand and too many heifers on hand, and the supply just keeps on coming and coming.”