I've noticed that possukim will switch back and forth between the vowelizing of the definite article heh, sometimes multiple times within the same possuk. Is there a rule for this or an explanation in Chazal for the switching between kamatz and patach?
The rule is:
The definite article is הַ (usually) followed by dagesh hazaq (e.g. הַמַּיִם), unless the word starts with אהח"ע or (usually) ר, in which case the default is הָ (e.g. הָאָדָם).
If the word starts with חָ, unstressed עָ or unstressed הָ, the definite article becomes הֶ (e.g. הֶחָד or הֶעָנָן). In other cases of words starting with ח or ה, the definite article takes the usual form הַ (e.g. הַחַשְׁמַל).