The Americans took a 1-0 lead when Morgan Brian's header hit the crossbar and bounced in after hitting Ghana defender Kinda Addai for an own goal in the 20th minute.
Hayes doubled the lead five minutes into the second half, heading in a cross from Kealia Ohai, and made it 3-0 in the 74th with a right-footed shot from just outside the box.
Hayes completed her hat trick two minutes into injury time when she chipped goalkeeper Patricia Mantey to score her 15th goal in international play.
"It's always exciting to come into an atmosphere like this," Hayes said. "It was great to get three goals, but I couldn't have done it without the help of my teammates. This team brings out the best in me."
"We came away with the result we wanted today and I couldn't be happier for Maya," U.S. coach Steve Swanson said.
"She has worked very hard and showed the explosiveness she has."