Rear Window got its start as a short story called "It Had to be Murder" by Cornell Woolrich. It was snapped up by Paramount and turned over to Hayes, who'd just come to Hollywood a few years earlier after spending most of his career after World War II in radio. Rear Window was his first collaboration with Alfred Hitchcock, and he must have done something right. They worked together three more times in the 1950s, following up this film with To Catch a Thief, The Trouble With Harry, and The Man Who Knew Too Much.
Hayes seemed to have found exactly the right tone Hitchcock was looking for in these movies. He excelled at light, witty dialogue and could use dark humor quite well to get a few ghoulish giggles out of the audience. That suited Hitch just fine, as he enjoyed injecting some gallows humor into his films. In one case, the two actually based a whole movie on a darkly comic premise: The Trouble With Harry is about a body that won't stay buried.
Hayes picked up an Oscar nomination for Rear Window's screenplay. (He lost to a movie called The Country Girl, which incidentally won a Best Actress Oscar for Grace Kelly.) He kept writing screenplays well into the 1970s and retired from the movie biz in the '80s to teach writing at Dartmouth College, although he came back one more time for a movie called Iron Will. He died in 2008 at the ripe old age of 89.