ATM's only offer the best rates if you don't have to pay ATM fees on international transactions.
In general, the rates at the airport will get you 40-70 baht less per $100 than the better banks and change kiosks in downtown Bangkok. But smaller bills are better deals at the airport, because the downtown changers give better rates on $50s and $100s than for $5s, $10s, and $20s
Once you are within Bangkok, I find that the various banks and change kiosks are generally all within 10 baht (which translates to around 30-35 cents) of each other per $100 US.