Quoting Commentary for II Chronicles 28:23

וַיִּזְבַּ֗ח לֵֽאלֹהֵ֣י דַרְמֶשֶׂק֮ הַמַּכִּ֣ים בּוֹ֒ וַיֹּ֗אמֶר כִּ֠י אֱלֹהֵ֤י מַלְכֵֽי־אֲרָם֙ הֵ֚ם מַעְזְרִ֣ים אוֹתָ֔ם לָהֶ֥ם אֲזַבֵּ֖חַ וְיַעְזְר֑וּנִי וְהֵ֛ם הָֽיוּ־ל֥וֹ לְהַכְשִׁיל֖וֹ וּלְכָל־יִשְׂרָאֵֽל׃

For he sacrificed unto the gods of Damascus, which smote him; and he said: ‘Because the gods of the kings of Aram helped them, therefore will I sacrifice to them, that they may help me.’ But they were the ruin of him, and of all Israel.

Rashi

he will have no contentment Whether he shows him an angry countenance or he shows him a laughing countenance, there is no contentment either in this or in that. He finds no satisfaction. We find in the case of Amaziah that the Holy One, blessed be He, showed him a laughing countenance and delivered Edom into his hands, and when he returned from defeating them, (11 Chron 25:14) “he brought their (sic) gods, etc. and prostrated himself before them.” To Ahaz, the Holy One, blessed be He, showed an angry countenance and delivered him into the hands of the kings of Aram (ibid. 28:23): “And he sacrificed to the gods of Damascus, etc. for he said, ‘The gods of Aram are helping them.’”
Ask a RabbiBookmarkShareCopy

Rashi

Before [king Achaz] came. [He built the altar] before the king came from Damesek.1Achaz decided to worship the idols of Arom because he believed they were responsible for his defeat. See II Divrei Hayomim 28:23.
Ask a RabbiBookmarkShareCopy