Hamon, the surprise winner of the first round of the Socialists' primary last weekend, has wooed voters with his staunchly leftist proposals, notably the idea of a universal basic income, dismissed as a “mirage” by Valls.
He also wants to legalise marijuana and tax robots that replace workers.
The 49-year-old Hamon, round-faced with a schoolboy haircut, has a crowd-pleasing eagerness that contrasts with the square-jawed assertiveness of Valls, 54, who was interior minister before becoming premier.
Hamon joined a rebellion against what he saw as the Socialist government's rightward drift under Valls and President Francois Hollande, quitting as education minister in 2014.
The combative Valls has dismissed him as a dreamer with no hope of becoming president in May.
Socialist voters face a choice between “certain defeat” with Hamon as their nominee and “possible victory” if they chose him, Valls declared confidently after the first round.
Yet polls show neither man making it past the first round in the presidential vote in April, with conservative ex-premier Francois Fillon, far-right leader Marine Le Pen and centrist ex-economy minister Emmanuel
Macron leading the field.
After two-and-a-half years as premier Valls believes he is the best-placed to defend France's interests in the face of a new protectionist world order. He has been particularly scathing of his rival's signature proposal for a universal basic income.
“I want nothing of these mirages that evaporate in an instant and that sow disillusionment (and) bitterness,” he told an earlier campaign rally.
Valls' parents, a Spanish painter father and Swiss-Italian mother, fled the dictatorship of Francisco Franco in Spain to settle in France, though they travelled back to Barcelona for his birth in August 1962. He gained French citizenship when he was 20.
He has four children from his first marriage to a teacher. In 2010 he remarried, to concert violinist Anne Gravoin. Valls makes no apologies for his pro-business stance and desire to modernise the Socialist party.
But his use of decrees to ram through contested economic reforms as prime minister, as well as a failed proposal to strip dual-national terrorists of their French citizenship, alienated many in the party.
Hamon, who hails from western Brittany, is the son of a dockworker father and secretary mother.
He began his political life as a student activist in the 1980s. In 1986, aged 18, he joined massive student protests against proposed reforms which then rightwing president Jacques Chirac was forced to withdraw.
A father of two with his partner Gabrielle Guallar, Hamon has a degree in history.
Valls has warned “the left could die” unless two “irreconcilable” factions — one pragmatic and open to reforms, the other wedded to the class struggle — unite.
Such statements have drawn comparisons to former British prime minister Tony Blair who dragged his Labour party towards the centre and won three successive elections.
But in recent years leftist voters across Europe have soured on the centre-left, preferring hard left leaders like Labour's Jeremy Corbyn in Britain or far-left parties like Spain's Podemos.
Valls is not the only one making dire warnings of a lasting rift within the party that swept the board in general elections just five years ago.
“The PS (Socialist Party) elephants have already broken everything in the china shop,” said Yann Marec, deputy editor of the southern Midi Libre newspaper said.
“Hamon the Breton and his promises against Valls the Catalan and his thrusting chin: the spectacle smells of blood.”