On July 31, 2008, Ramirez was traded to the Los Angeles Dodgers in a three-way deal. The Boston Red Sox acquired outfielder Jason Bay and minor league infielder Josh Wilson, and the Pittsburgh Pirates got infielder Andy LaRoche and pitching prospect Bryan Morris from the Dodgers and outfielder Brandon Moss and pitcher Craig Hansen from the Red Sox. Ramirez had always worn uniform number 24, but the Dodgers had retired that number in honor of Hall of Fame manager Walter Alston. Ramirez instead chose to wear number 99 with the Dodgers.