Complex sentence: To end their torment, the Commander formally surrenders and the ray is terminated.
Split into simpler sentences: To end their torment, the Commander formally surrenders. With these words, the ray is terminated.