After a dour first hour David Jones was caught in possession and substitute Gary Madine's low cross was slotted home from close range by Liam Feeney.
Gray tapped in a leveller after goalkeeper Paul Rachubka had done well to keep out his initial effort.
And the former Brentford man grabbed his 20th of the season with a tremendous strike in the 85th minute.
Media playback is not supported on this device
The 24-year-old raced on to Fredrik Ulvestad's pass before hitting an unstoppable shot.
It looked like the Clarets were going to leave the Macron empty-handed after Feeney tapped home, but Gray's double in 11 minutes gave them an 18th league win of the season.
The defeat means the Trotters, who this week agreed a takeover by the Sport Shield consortium headed by former striker Dean Holdsworth, are seven points adrift of safety with 12 games to play.
Burnley are now one point clear of Hull City and Middlesbrough, but have played once more match than the Tigers, and two more than Boro.
Bolton boss Neil Lennon:
"What you should do is get my quotes from the last few weeks and just put it in your report.
"Individual mistakes have cost us the game again. I can't be critical of the team because they were excellent today. I would have been disappointed with a draw, never mind losing the game. It's tough to take at the minute."
Lennon on the proposed takeover:
"I'm really fed up of talking about it. Dean's worked really, really hard at this. He's put his heart and soul into it so if anyone deserves to get it it will be him.
"Whether it goes through or not I cannot say. If it does then hopefully we can get the embargo lifted and strengthen the squad."
Burnley manager Sean Dyche:
"We were off our performance levels and still won, and that's what you have to do sometimes in the Championship, in all of football, but definitely in the Championship.
"Ian Holloway told me in private in the manager's room a couple of years ago, 'Your lads have got an unbelievably strong chin' - and he mentions it a lot now because the mentality is so firm here.
"I appreciate it doesn't guarantee you an outcome like that, but it gives you a whole better chance. I can imagine when I watch that back in the cold light of day with no noise, you'll see our reaction to their goal is pretty calm. It's 'get the ball lads, let's get on with it'.
"It's gone immediately. We talk to the players a lot about it, focus, refocus, what's the focus now? To go and grip the game."
Match ends, Bolton Wanderers 1, Burnley 2.
Second Half ends, Bolton Wanderers 1, Burnley 2.
Substitution, Burnley. Rouwen Hennings replaces Andre Gray.
Scott Arfield (Burnley) is shown the yellow card for a bad foul.
Wellington (Bolton Wanderers) wins a free kick on the left wing.
Foul by Scott Arfield (Burnley).
Corner,  Bolton Wanderers. Conceded by Fredrik Ulvestad.
Attempt missed. Stephen Dobbie (Bolton Wanderers) right footed shot from the right side of the box is too high. Assisted by Darren Pratley with a headed pass following a corner.
Substitution, Bolton Wanderers. Wellington replaces Jay Spearing.
Corner,  Bolton Wanderers. Conceded by Tom Heaton.
Mark Davies (Bolton Wanderers) wins a free kick on the left wing.
Foul by Joey Barton (Burnley).
Foul by Gary Madine (Bolton Wanderers).
Ben Mee (Burnley) wins a free kick in the defensive half.
Goal!  Bolton Wanderers 1, Burnley 2. Andre Gray (Burnley) left footed shot from outside the box to the bottom left corner. Assisted by Fredrik Ulvestad.
Substitution, Burnley. Fredrik Ulvestad replaces David Jones.
Offside, Burnley. James Tarkowski tries a through ball, but Andre Gray is caught offside.
Substitution, Bolton Wanderers. Stephen Dobbie replaces Zach Clough.
Gary Madine (Bolton Wanderers) wins a free kick on the right wing.
Foul by Ben Mee (Burnley).
Corner,  Bolton Wanderers. Conceded by Ben Mee.
Liam Feeney (Bolton Wanderers) wins a free kick on the left wing.
Foul by Scott Arfield (Burnley).
Goal!  Bolton Wanderers 1, Burnley 1. Andre Gray (Burnley) right footed shot from the right side of the six yard box to the centre of the goal.
Attempt saved. Andre Gray (Burnley) right footed shot from the centre of the box is saved in the top right corner. Assisted by Matthew Lowton.
Substitution, Burnley. Matthew Taylor replaces George Boyd.
Goal!  Bolton Wanderers 1, Burnley 0. Liam Feeney (Bolton Wanderers) right footed shot from very close range to the centre of the goal. Assisted by Gary Madine.
Foul by Gary Madine (Bolton Wanderers).
Joey Barton (Burnley) wins a free kick in the defensive half.
Attempt blocked. Joey Barton (Burnley) right footed shot from outside the box is blocked. Assisted by David Jones.
Substitution, Bolton Wanderers. Gary Madine replaces Emile Heskey.
Hand ball by Andre Gray (Burnley).
Attempt missed. James Tarkowski (Burnley) right footed shot from the right side of the box is close, but misses to the left following a set piece situation.
Foul by Jay Spearing (Bolton Wanderers).
Sam Vokes (Burnley) wins a free kick in the attacking half.
Attempt missed. Emile Heskey (Bolton Wanderers) left footed shot from outside the box is high and wide to the left.
Corner,  Burnley. Conceded by Derik.
Corner,  Bolton Wanderers. Conceded by Ben Mee.
Offside, Burnley. Joey Barton tries a through ball, but Andre Gray is caught offside.
Attempt missed. Liam Feeney (Bolton Wanderers) right footed shot from the left side of the box is close, but misses the top right corner. Assisted by Mark Davies.
Burnley came from behind to go top of the Championship thanks to Andre Gray's double at lowly Bolton.