Is there refraction upon frustrated total internal reflection? If the incidence angle of a light ray on an interface is greater than the critical angle, but theres a third medium with a higher refractive index than the second, lower refractive medium ~ few wavelegths away from the interface, light undergoes frustrated total internal reflection. My question is: is the transmitted light undergoing refraction according to the difference between refractive index of the two first and third medium or does it pass in a straight line, as is usually portrayed on visual representations of frustrated total internal reflection?
 A: Indeed, typically frustrated total internal reflection is portrayed as the ray passing into the third medium without refraction with respect to the first medium. This is merely because the simplest case is considered – that of identical materials of the first and third media.
But if the materials have different refractive indices, it's easy to see that refraction must occur. Consider what happens when the thickness of the second medium (the gap) is zero: this is the case of usual refraction, without any total internal reflection, frustrated or not.
Now, as you make a gap, nothing changes at the interface of the third medium with its neighbor except amplitude of the EM field (because only evanescent wave is passed due to TIR). But this same change of conditions at the interface could be done by simply reducing intensity of the incident radiation instead of introducing the gap. From this immediately follows that refraction still occurs as it would in the intensity reduction case, and the angle remains the same. All this means that whatever the gap, refraction still occurs, and refraction angle is still governed by Snell's law.
To illustrate this, here's a comparison of the FTIR in the case of identical materials of the first and third media ($n=2.4$, animation on the left), and different materials ($n_{\text{bottom}}=2.4,\,n_{\text{top}}=3.7$, animation on the right)$^\dagger$:

(If you can't see the animation, try this version).

$^\dagger$ Simulation done using an open-source Maxwell2D software, adapting their total_internal_reflection2.cfg example; edited example available here
