Opening of a protonated epoxide
The opening of the halonium ion closely resembles that of an epoxide in acidic medium:

Epoxides are slightly basic, so in acidic medium a good number of molecules are protonated. The electrophilicity of the carbons bonded to the protonated oxygen increases considerably and the C–O bonds are weakened.
If the epoxide is unsymmetrical, cleavage of the C–O bond leading to the more substituted carbocation is the most favourable. The mechanism resembles SN1, but the attack of the nucleophile (here, methanol) takes place almost at the same time as the C–O bond breaks: a free carbocation is never formed. That is why, although the mechanism resembles SN1, the configuration of the attacked carbon is inverted.
The same happens with the halonium ion: the nucleophile attacks the carbon that best supports the positive charge, from the side opposite the halogen.