[1] Gray was elected in a by-election in the Edmonton after the death of George Van Allen.
The by-election was considered the first test of strength for the Alberta Social Credit Party government.
He defeated 2 time Edmonton Mayor Joseph Clarke, who ran as a People's Candidate backed by Social Credit, and Communist Leader Jan Lakeman.
Gray served as Alberta Liberal Party leader until 1940, strongly favouring a coalition arrangement with the Conservatives and some former United Farmers of Alberta members against Social Credit.
He ran in Bow Valley in the 1940 Alberta election, but was defeated.