There is a coach (bus) station at Heathrow. Follow signs for a long walk directly to the station. It's cheaper to buy tix in advance, but they can be bought on-the-spot also. Some buses to Bath fill up and you may need to wait for the next one.
FUNFARES, at only a few pounds, are available online when you make your reservation early. I've reserved a roundtrip London-Bath from Victoria St. for 10 GBP. I like the train better, and it's faster, but I'm on a tight budget this time and thought I'd try the coach. I reserved my tix a couple of months ago.
From Heathrow it takes about 2 1/2 hours; from Victoria the coach takes 3 hours. The train from Paddington takes about 1 1/2 hours. I think a new coach station is being built, but last time I was there the temporary coach station was a few blocks from the old coach station.