Bench coach Torey Lovullo will take over as manager.
Farrell's doctors discovered the cancer during the hernia surgery he underwent on Monday.
Farrell, 53, returned to watch the team take batting practice immediately after the surgery, but he was unable to stay for their game against the Marlins. Boston's 5–4 loss to Miami that day was the first game Farrell had missed since he became the team's manager.
Farrell has managed the Red Sox for three seasons, leading them to a World Series title in 2013. He previously managed the Blue Jays for two seasons, and was Boston's pitching coach from 2007–10.
In the Red Sox’ first game without Farrell and under Lovullo, Boston defeated the Seattle Mariners 15–1 on Friday night.
The Red Sox are in last place in the AL East with a 51–64 record.
- Erin Flynn