The correct answer is: D. Anangpala
Anangpala was the Tomar ruler of Delhi from 1019 to 1037 CE. He was defeated by Masud of Ghazni in 1037 CE.
Tejpala was the Tomar ruler of Delhi from 999 to 1019 CE. He was succeeded by Anangpala.
Kumarapala Dev was the Chaulukya ruler of Gujarat from 1010 to 1042 CE. He was not defeated by Masud of Ghazni.
Vigrahapala was the Pala ruler of Bengal from 1018 to 1052 CE. He was not defeated by Masud of Ghazni.
Masud of Ghazni was a Turkic ruler of the Ghaznavid Empire. He invaded India several times, and defeated several Indian rulers, including Anangpala.