Boston beats Detroit in ninth