In exchange, the Dodgers sent pitchers Edwin Jackson and Chuck Tiffany to Tampa Bay.
Baez served as the primary closer for the Devil Rays the last two seasons with 71 saves in 82 chances. Last year, he had a 5-4 record with a 2.86 ERA and 41 saves in 67 games.
The 28-year-old right-hander has a 26-31 career record with a 3.69 ERA and 102 saves in five seasons. He broke into the majors in 2001 with Cleveland before joining the Devil Rays prior to the 2004 campaign.
Carter, 31, went 1-2 with a 4.89 ERA in 39 relief appearances in 2005. Over parts of five seasons, the right-hander has a 13-11 mark with a 3.94 ERA.
Ray Liotta sues skin care company over use of likeness
NBC reportedly holds celebs hostage to Jimmy Fallon's show