Five Star Quality Care is selling its pharmacy business for $30.7 million, the company said Tuesday.