To end their torment, the Commander formally surrenders and the ray is terminated.
The Commander formally surrenders. This was to end their torment. The ray is terminated. This was to end their torment.