The Boston Red Sox avoided being swept at home as they edged out the 4-3 victory over the Toronto Blue Jays in extra innings.