The 33-year-old has made the decision after consulting two specialists over an ankle injury suffered in January.
Beattie made 238 appearances for the club since joining from Exeter in 2001 and was capped by England A in 2005.
"I am obviously gutted not to be able to carry on playing the game I love, but having sought medical advice I have to take it seriously," Beattie said.
"I've had a fantastic career and have been very lucky to be able to play for such a long time at a club like Bath.
"I'd like to thank everyone that's helped me throughout my career, from team-mates, to coaches, to the physios who have put me back together a few times."
The Rugby Players Association have pledged to assist Beattie as he adapts to life outside of the game.
"It's always said when retirement is forced on a player," RPA chief executive Damian Hopley said.
"As with all our RPA members, we will support Andy during this transition and will help him assess options for the next stage of his career.
"On behalf of everyone at The RPA I would like to congratulate Andy on all he has done for the game throughout his fine career and wish him the very best of luck for the next exciting stage of his life."
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
$29.99
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.