Robert D. Ray, the moderate Republican who has been governor of Iowa for the past 14 years, announced his retirement yesterday, ending an era in his state and adding another worry to the growing list of Republican headaches in the Midwest.

The 53-year-old lawyer, the nation's senior governor and the longest-serving in the history of Iowa, explained his surprise decision by telling a news conference in Des Moines, "I am at a time in my life when I might like to try new things." He said he would remain active in politics but seek no other office this year.

Ray is the fourth Midwest GOP governor leaving office this year, joining Michigan's William G. Milliken, who has served only a few weeks less, Ohio's veteran James A. Rhodes and Minnesota's first-termer Albert H. Quie. Of the four, only Rhodes was ineligible to seek re-election.

All four were part of the backbone of the declining moderate wing of the GOP and all four of their seats are now major targets for Democratic takeover, which could alter the political landscape of the Midwest. The region has been hard-hit by the slump in the auto industry and agriculture.

None of the four was stronger politically than Ray, who retained extraordinary popularity from his first victory in 1968 right through the most recent polls, showing him a strong favorite if he sought re-election in November. He was elected five times, the first three for two-year terms and the last two for four-year terms.

A former Republican state chairman, his appeal crossed party lines and appeared to be based on his reputation as a thoughtful, conscientious and scrupulously honest official. Some of his major accomplishments--such as his leadership of a successful refugee resettlement program after the Vietnam war--were more civic enterprises than traditional governmental programs.

But his years as governor were marked by major investments in education, energy conservation, environmental protection and transportation, for which his leadership is credited.

Ray played a national role as chairman of the National Governors Association and head of the 1976 Republican Platform Committee, but he passed up many chances to run for the Senate or occupy a Cabinet seat. His low-key personality and distaste for self-promotion kept him from being a visible power-broker in national politics, but among governors of both parties, few men enjoyed greater respect than Ray.

His control of the Iowa GOP was repeatedly challenged by conservatives, who defeated his favorites for the Senate in 1978 and 1980 and elected Roger W. Jepsen and Charles E. Grassley to the Senate.

Ray's lieutenant governor, Terry E. Branstad, who is aligned with the conservative faction, is considered certain to seek the GOP nomination, but he may be challenged by former Lt. Gov. Arthur Neu, a moderate who served in the post from 1972 through 1978.

The active contenders on the Democratic side are Roxanne B. Conlin, a former U.S. attorney, and former state Democratic chairman Edward Campbell, but Iowa political observers speculated that Ray's withdrawal may bring others into the race. Earlier this year, it appeared likely that the Democratic nominee would be Harold E. Hughes, the popular former governor and U.S. senator, but the prospect of lengthy litigation over Hughes' compliance with the state residency requirement caused him to withdraw.