He attended Lewistown High School and graduated from the law department of Valparaiso University in 1903.
He was the first governor of Montana to be born in what became the state of Montana. He was admitted to the bar the same year and commenced practice in Lewistown, He also became engaged in ranching and the raising of livestock. Ayers served as attorney of Fergus County, Montana from 1905 to 1909, and Judge of the Tenth Judicial District of Montana from 1913 to 1921.
During the First World War, Ayers served as chairman of the Fergus County Exemption Board.
He was the Justice of the State supreme court from January 1922 until his resignation on November 22, 1922, when he resumed ranching and the private practice of law in Lewistown. In 1932, Ayers was elected to the United States House of Representatives from Montana"s 2nd congressional district, defeating Republican Congressman Scott Leavitt.
He was re-elected over Republican nominee Stanley Felt in 1934 in a landslide. Rather than seek re-election to a third term, Ayers opted to run for Governor in 1936, and narrowly defeated incumbent Governor Elmer Holt in the Democratic primary.
In the general election, he barely defeated former Lieutenant Governor of Montana Frank Hazelbaker, the Republican nominee.
During his administration, he oversaw the expansion of the state bureaucracy, signed a bill to give the governor new powers in directing state government, the state deficit was eliminated, and state bond interests were lowered. He ran in the Democratic primary to challenge Ford in 1944, but came in third behind Leif Erickson and Austin B. Middleton. He was a delegate to the Democratic National Conventions in 1920 and 1940, and to every State Democratic Convention from 1906 to 1940.
After ending his political career, Ayers returned to ranching.
He died in Lewistown, Montana, and was interred at the Lewistown City Cemetery in 1955.
He served as a member of the United States House of Representatives and as the 11th Governor of Montana.