A thumping late free-kick from Brandon Miele brought Shamrock Rovers a laboured first win in five games.
Defeat was harsh on Bray who frustrated Rovers for most of the game at Tallaght Stadium until the redeeming moment of a dour encounter arrived on 88 minutes.
Miele, upended on the edge of the area by Bray defender Niall Cooney, stepped up to blast the resulting direct free-kick through the wall to the net.
The win moves Rovers five points ahead of St Patrick's Athletic in the race for third place and a guaranteed Europa League spot.
A poor crowd made for a muted atmosphere as Rovers struggled to impose themselves on a well-organised Bray side.
It took a sluggish Rovers 23 minutes to show any real menace with Bray left-back Michael Barker snuffing out the threat of Mikey Drennan as he tried to latch onto Damien Duff's through ball.
Rovers' first real shot in anger arrived a minute later when Miele (right) was off target from distance.
Indeed, Bray had the only shot on target during a decidedly dour first half.
John Sullivan fed Chris Lyons in the inside right channel with the little striker dipping around Max Blanchard to bring a tip-over save from Barry Murphy with a crisp right-footed drive.
With Bray continuing to look the more dangerous side, Blanchard got tighter to deflect a shot from Graham Kelly out for a corner on 34 minutes.
Hugh Douglas got his head to Ryan McEvoy's delivery to glance his effort well wide.
Thankfully, there was a trifle more impetus to the game on the resumption.
Rovers 'keeper Murphy made a comfortable save from Hanlon's weak shot before Drennan ran through to bring a more telling stop from Peter Cherrie at the other end on 52 minutes.
Cherrie was worked again just past the hour mark to get a vital touch to tip the ball over the top after Gavin Brennan cut in on the right to work the Bray 'keeper with a stinging left-foot effort.
Bray remained well in the game, though, and carved perhaps their best opening on 70 minutes.
Cassidy found himself in space on the right to put over a low cross to the near post which McEvoy, at a stretch, toed narrowly wide.
Shamrock Rovers - Murphy; Madden, Kenna, Blanchard, D O'Connor; G Brennan, McCabe (R Brennan 90), McPhail (Cregg 72), Miele; Duff (North 67); Drennan.
Bray Wanderers - Cherrie; Douglas, Cooney, McNally Barker; Cassidy, Kelly, Sullivan, McEvoy, Hanlon (Wixted, 83); Lyons (Scully, 80).
Ref - Paul Tuite (Dublin)