Upvote:2
You will need a visa, assuming you are Bahamian and planning to come back to the Bahamas.
On the out bound flight to Cancun, you can pre-clear US Immigration in Nassau or Freeport and assuming you meet the requirements for Bahamians (no criminal record, traveling for tourism, etc), can enter without a visa for up to 30 days. But on your return trip from Cancun, you will need a visa to stop-over in Atlanta (or any other USA airport). If by chance you don't meet the pre-clearance rules, you would need a visa going both ways.
You can find more indepth info on this on the US Embassy website for the Bahamas: http://nassau.usembassy.gov