Before a case-ending beginning with a consonant, ā is substituted for the final of rai,
As राभ्याम्, राभिः ॥ But रायौ, रायः before affixes beginning with a vowel. Why 'a case ending'? Observe रैत्वम्, रैता ॥,
Adhyāya 7 · Pāda 2 · Rule 85
Before a case-ending beginning with a consonant, ā is substituted for the final of rai,
As राभ्याम्, राभिः ॥ But रायौ, रायः before affixes beginning with a vowel. Why 'a case ending'? Observe रैत्वम्, रैता ॥,