Total internal reflection occurs only when the ray travels from an optically denser to rarer medium.
Total Internal reflection happens only when light is travelling from an optically denser medium to an optically rarer medium.