Foy graduated from Kenyon College in 1979 and later worked for two Democratic Ohio state senators. After several years, he attended North Carolina CentralUniversity School of Law studying environmental law. Foy paid attention to land-use decisions made by the town of Chapel Hill and noted that in 1995 the town was "a really nice place that was going to be exploited by people selling it out."
Foy and his neighbors sued Chapel Hill in 1995 to prevent development that the town had approved of 15 houses in a floodplain of. Foy did some of the legal work to save on costs. They lost the case at both the district and appellate levels, though the town renegotiated with the developer to keep the space open. He ran for mayor in 1995 after he and his neighborhood had lost a second land-use case to the town. He and several other neighborhood groups opposed the then-proposed development of Meadowmont, North Carolina. The incumbent mayor, Kenneth Broun, was not seeking reelection, so Foy ran against town council member Rosemary Waldorf. Foy was labeled an "antigrowth" candidate, which he said was inaccurate, and he was seen as a newcomer to the town. He was endorsed by the Sierra Club and the Independent Weekly. Foy spent $3,000 and lost the election receiving 46 percent of the vote. In his 1997 campaign for town council, Foy again received endorsements from the Sierra Club and the Independent Weekly as well as support from several sitting members. He received the second-highest number of votes among the eight candidates, securing a seat. He was sworn in to town council on December 1, 1997. He decided not to run for mayor in 1999, only two years into his four-year town-council term and thought Waldorf was doing a good job.
2001–2009: Mayoralty
Mayor Waldorf decided not to run for a third term in 2001, prompting Foy to enter the race. He ran against Lee Pavao, a fellow town council member. Donations from individuals were limited to $200; each candidate spent $25,000 on the campaign. Foy's campaign focused on three things: protecting the environment; inclusivity, like affordable housing; and university–town relations. Pavao, a businessman, supported Meadowmont's development, though both were in favor of "smart growth". During the election, Foy continued running his law practice. He won by a considerable margin, against expectations that the race would be closer. Foy was sworn in as Mayor of Chapel Hill for his first two-year term on December 3, 2001. He was reelected in 2003 against just write-in votes and in 2005 against a "stealth candidate" who had moved to Chapel Hill just a week before the filing day. Local news noted that Foy had done a similar thing in 1995. The "stealth candidate", Kevin A. Wolff, ran again in 2007. As mayor, Foy negotiated the expansion of the campus of the University of North Carolina at Chapel Hill. Several times, UNC wanted to expand, so community members spoke in opposition to the town council, and the mayor and council generally approved the expansion if it was appropriate. He also formed a downtown partnership group with input from UNC and businesses on Franklin Street. After town manager Cal Horton's resignation in September 2006, Foy selected Roger Stancil to fill the position, who was unanimously confirmed by the council. Foy was the chair of the state's Metropolitan Mayor's Coalition, promoting the fare-free Chapel Hill Transit and asking the Department of Transportation to keep maintaining major roads. He kept CHT from merging with the Triangle Transit Authority in 2003 and kept the town library separate from that of the county. Foy has remarked that his two main achievements while in office were rewriting the town's land-use ordinance and renaming a main thoroughfare in honor of Martin Luther King Jr. The town manager had recommended an elaborate process for citizen input about land use, which tired some town council members, though Foy kept up the energy to secure reform. Airport Road was renamed Martin Luther King Boulevard, which raised tensions in Chapel Hill over financial concerns of changing addresses on paper, giving up a long-time address, and race. The United States Conference of Mayors awarded Foy the Climate Protection Outstanding Achievement Award in June 2008 and named Chapel Hill America's Most Livable City in June 2009. Foy and the council asked the state legislature to repeal the Defense of Marriage Act and had Chapel Hill grant domestic partnerships. Foy did not seek reelection in 2009 and considered a run for U.S. Senate in 2010. Support for incumbent senator Richard Burr, however, was greater than that of any Democrat, including Foy. Foy endorsed the 2009 campaign of his eventual successor, Mark Kleinschmidt.