The Aviva Premiership outfit were forced into an injury-enforced change just before kick-off as Sam Vesty started at centre instead of Matt Banahan.
POOL 3 TABLE
1. Glasgow Warriors - 4 points
2. Leinster - 2 points
3. Montpellier - 2 points
4. Bath - 1 points
Ian McGeechan's side pressed hard from the first minute and Glasgow were penalised for not releasing in the tackle and Heathcote successfully kicked his first penalty.
But a Bath infringement allowed Weir to quickly level.
Dan Hipkiss broke well on the right and Bath recycled the ball several times without being able to find a way through the Glasgow defence.
The Warriors were forced to retreat again as Francois Louw threatened but the hosts continued to hold firm.
A mammoth kick by Heathcote from halfway sailed through the posts to regain the lead for Bath.
Handling errors allowed Bath to turnover and put Glasgow under more pressure but Sean Lineen's side survived the onslaught before Weir's second penalty, from near halfway, was short and to the right of the posts.
World Cup-winning All Black Donald kicked Bath ahead before Gray's try
Bath lock Ryan Caldwell and Glasgow scrum-half Chris Cusiter escaped with a telling-off and a shake of hands after a spat at a ruck and the upshot was another successful Weir penalty moments before the break.
A pulled-down scrum at the start of the second half led to another Glasgow penalty but Weir's effort from near the Bath 10m line was wide.
It was the Glasgow scrum that was penalised moments later and Heathcote duly levelled with another accurate kick.
Another infringement, this time trying to pull the ball out at a ruck, allowed Heathcote to kick Bath into the lead once again.
A Glasgow line-out was well won by Gray and the ball was worked forward to substitute Troy Nathan, who laid off well for Hogg to cross the line and claim the game's first try.
But the Warriors were penalised twice in quick succession and Heathcote kicked Bath back into the lead.
The pendulum swung again when Glasgow were awarded another penalty to give Weir a simple kick.
However, another infringement at the scrum gave Bath another penalty and Heathcote's replacement Stephen Donald kicked the English side ahead.
Sean Lineen's side pressed for a winning score and a favourable bounce off Weir's kick allowed Gray to retrieve and force the ball over the line, Weir's conversion completing the win.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.