Paul Keegan punished a dreadful error by Ciarβn Kavanagh to lay the foundation for this win which ended Bray's recent poor run and plunged Dundalk into further difficulty - they are third from bottom of the table.
Kavanagh miskicked Stephen Fox's 69th-minute cross and it spun into the path of Keegan who shot home the easiest of his five goals this season.
Substitute Martin Reilly then spurned an excellent chance to get Dundalk back into the game before Keegan set up Thomas Morgan for Bray's second, killer-goal on 78 minutes.
Keegan did well to get to the end-line and pull the ball back for Morgan who turned to shoot home off a post. Eddie Gormley then added the third goal seven minutes from the end when his free-kick found the net despite the efforts of John Connolly.
The sides might have swapped at least two goals each in a mistake-ridden first half.
Bray, desperate to end a run of three straight defeats, had a double let-off mid-way through the half. John Flanagan headed against a post from a Jonathan Prizeman free-kick with Alex Nesovic heading the rebound over the bar. Nesovic then missed a sitter when ballooning the ball over the top from James Keddy's cross on 27 minutes.
The crossbar came to Bray's rescue early in the second half when Farrell saw his header from Ward's centre come back of his own woodwork, before Kavanagh's error at the other end soon turned the game.
DUNDALK: Connolly; Hoey, Broughan, McGuinness, Crawley; Kavanagh (Robinson 78 mins), Flanagan, Prizeman, Keddy; Nesovic (Reilly 67 mins), Ward.
BRAY WANDERERS: Gregg; Tresson (Britton 61 mins), Doohan, Lynch, Farrell; O'Connor, Morgan (Long 86 mins), Gormley, Keogh; Fox (O'Brien 88 mins), Keegan.
Referee: H Byrne (Dublin).