Ben Spies has announced his retirement from MotoGP racing after admitting defeat in his efforts to return from a serious shoulder injury.