The Bulfinch Cos., a Boston-based investment firm with more than $2.5 billion in assets, has purchased The Sphere apartment building in Medford, Massachusetts, from the property’s developer Dark Horse Capital Partners for $23.13 million, or about $551,000 per unit.