Context Word: dismay. 
Question: Much to the dismay of PersonX, PersonY learned of their evil plan, and _ was stopped before it succeeded. 
Answer: PersonX
Much to the dismay of PersonX, PersonY learned of their evil plan, and _ stopped them before it succeeded.