For light entering an interface from region 1 to region 2, where region 1 is a dielectric medium with refractive index $n_1$, and region 2 is an absorbing medium with complex refractive index $n_2 = n_2 + ik_2$. In a dielectric-dielectric case, the angle of refraction $\theta_2$ is given by
$$\sin \theta_2 = \frac{n_1}{n_2} \sin \theta_1 \, .$$
However, for an absorbing medium 2, the absorption index $k_2$ also plays a role in determining the angle. When $k_1 = 0$, we can solve directly for the refraction angle [from Bell1969]:
$$\sin \theta_2 = \frac{n_1}{n_2} \sin \theta_1 \, F^{1/2}$$
for
$$F = \frac{1}{2} \frac{-(n_2^2 – k_2^2 + n_1^2 \sin^2 \theta_1) + \big( (n_2^2 – k_2^2 + n_1^2 \sin^2 \theta_1)^2 + 4 [ n_2^2 k_2^2 – n_1^2 (n_2^2 – k_2^2) \sin^2 \theta_1] \big)^{1/2}}{k_2^2 – n_1^2 \big[ 1 – (k_2^2 / n_2^2) \big] \sin^2 \theta_1} \, .$$
The figure below shows a set of calculations for several example absorbing media, following the values chosen by Parmigiani1983.

Curves showing the angle of refraction $\theta_2$ in an absorbing medium as a function of the angle of incidence $\theta_1$ in air. The solid curves give the generalized calculation of the refraction angle, while the dashed curves give the standard Snell law solution. We can see that the standard Snell law approximates the generalized solution for small angles in every case. The last curve does not have a corresponding dashed curve because the two coincide, as they should, since this is a dielectric interface.

A Python script for calculating the generalized refraction angle is shown below.

def generalized_snell(theta1, n1, n2, kappa2):
a = n2**2 - kappa2**2 + n1**2 * (sin(theta1)**2)
b = a**2 + 4.0 * (n2**2 * kappa2**2 - n1**2 * (n2**2 - kappa2**2) * (sin(theta1)**2))
c = kappa2**2 - n1**2 * (1.0 - (kappa2**2 / n2**2)) * (sin(theta1)**2)
numerator = -a + sqrt(b)
denominator = c
F = 0.5 * numerator / denominator
theta2 = arcsin((n1 / n2) * sin(theta1) * sqrt(F))
return(theta2)

Parmigiani1983 also gives a more general equation, for the case when region 1 has refractive index $n_1 > 1$. Unfortunately, it takes the form of the following transcendental equation, so that we need to use an indirect solver to obtain the solution for $\theta_2$:
$$\sin^4 \theta_2 \Big[ \Big( \frac{n_2^2 k_2^2}{n_1^2} \sin^2 \theta_1 \Big) – (n_2^2 – k_2^2) \Big] + \sin^2 \theta_2 \big[ (n_2^2 – k_2^2) + n_1^2 \sin^2 \theta_1 \big] – n_1^2 \sin^2 \theta_1 = 0$$
I have tried to implement this, using a general-purpose nonlinear solver, but my casual initial efforts failed. It likely requires a more intelligent approach than the plug-in-and-go method that I’ve used so far.

Note that when there is an interface with an absorbing medium, no “critical angle” exists.

Another interesting feature of these interfaces with absorbing media is that the sum of the reflectivity and transmittance is no longer 1. Instead, $R + T = 1$ needs to be modified to include an additional term $\Delta$ corresponding to absorption loss at the interface: $R + T + \Delta = 1$. [Lodenquai1991,Weber2014] At normal incidence, this extra term is
$$\Delta = 1 – \frac{4 k_2 (n_1 k_2 – k_1 n_2)}{n_1 \big| \tilde{n}_1 + \tilde{n}_2 \big|^2} \, .$$
At least, I think that is what Lodenquai’s Eq.~(20) says — his use of the division symbol is unclear here, and since the quantities involved are all unitless, it is not possible to use units to check.

• [Bell1969] R. J. Bell, K. R. Armstrong, C. S. Nichols, & R. W. Bradley, “Generalized laws of refraction and reflection,” J. Opt. Soc. Am., 59, 187-189 (1969)
• [Lodenquai1991] J. F. Lodenquai, “Electromagnetic wave propagation in media with complex refractive indices and transmission through absorbing films,” Am. J. Phys. 59, 248–254 (1991).
• [Parmigiani1983] F. Parmigiani, “Some aspects of the reflection and refraction of an electromagnetic wave at an absorbing surface,” Am. J. Phys. 51, 245–247 (1983).
• [Weber2014] H. Weber, “The Fresnel equations for lossy dielectrics and conservation of energy,” J. Mod. Opt. 61, 1219–1225 (2014).