SPL: Motherwell 4 Hamilton Academical 0
Ian Baraclough's hosts had nothing to show for enjoying the better of the opening 45 minutes in the Scottish Premiership clash but put their rivals to the sword after half-time.
Ainsworth fired home a sensational long-range strike in the 49th minute and doubled his tally a minute later.
Hamilton's evening continued to unravel as Darren Lyon was sent off for an ugly lunge on Marvin Johnson before Ainsworth turned provider for substitute John Sutton to head home.
Sutton completed the scoring from the penalty spot seven minutes from time when Ziggy Gordon clumsily brought down Lee Erwin.
Motherwell now sit four points clear of bottom club St Mirren, while fifth-placed Hamilton's winless run now stands at 11 games.