After Flyers goalie Brian Elliott made a pair of big stops on Ondrej Kase and Hampus Lindholm with just over a minute left in overtime, Jakub Voracek made a great headman pass to Hayes, who slipped a backhand past John Gibson for the victory.
Gibson had made a handful of big stops of his own in overtime, but had little chance on this one, as the Ducks failed to capture a second straight victory for the first time since early November.
"We had a good third period. It seems like we're a little inconsistent," Gibson said. "We have a lot of young guys. It's tough to be good every night. We're learning it the hard way. If you want to be an NHL player, you have to bring it every night. Some nights you aren't going to feel great or have the best legs, but you have to find a way. We're learning that the hard way."
The Flyers were coming off a 6-1 thrashing in San Jose less than 24 hours ago, but hardly looked beaten down tonight, throwing 35 shots at Gibson on the night.
"We didn't have the execution, that's for sure," said Ducks coach Dallas Eakins. "I'm not sure why. That game should've been the first game out of the break. We had it coming out of the break, and not to have it tonight is disappointing. With better execution, I think we could've won the game."
It looked like it might be a high-scoring affair early, when an Erik Gudbranson slap shot snuck under Elliott's arm just 35 seconds after the opening faceoff.