What happens to the momenta of photons when light enters a medium Light refracts as it enters a medium as the velocity decreases because the permittivity and permeability changes. So is there a change of momentum of a photon entering a refractive medium? And if there is a change of momentum, how is the instantaneous change of it justified?
Also one more question: light refracts to take the shortest path. But when light refracts to do so, it refracts in a straight line. This sounds as if light knows of the medium ahead of it. So, how is there no time at all needed for the refractions to occur as light enters the medium?
 A: As momentum is conserved the momentum of the dielectric plus photon must be equal to that of the free photon. Part of the energy and momentum of the original photon therefor resides in the medium.  The description of conservation laws is not without controversy in general in the present theory and I am not going to solve that here. 
A: You are asking about the QM level, what happens to photons. 
What actually happens to the photon as it travels through the medium, depends on the medium too. In air for example, it is Rayleigh scattering (gives blue color to the sky), in other media it could be different type of scattering.
It is very important to understand that as per QM it is all probabilities. A photon could get scattered (or absorbed) in different ways.
When a photon tries to enter the medium, two things can happen:


*

*reflection (elastic scattering), and the photon does not enter the new medium, returns to the original medium, the photon keeps its energy, changes angle (momentum vector change). In this case, the photon exerts pressure on the surface of the reflective medium (like a mirror), this is called radiation pressure, and this is how solar sails work.


https://en.wikipedia.org/wiki/Radiation_pressure
https://en.wikipedia.org/wiki/Solar_sail


*refraction, the photon enters the new medium, three things can happen:


*

*elastic scattering, the photon enters the new medium, and gets elastically scattered, keeps its energy, changes angle (momentum vector change) as it interacts with the mediums atoms as it moves forward in the medium, this is like in air, Rayleigh scattering.



https://en.wikipedia.org/wiki/Elastic_scattering


*

*inelastic scattering, the photon gives part of its energy to the atom/electron, and changes angle (momentum vector change). This is usually where the photons energy in part turns into the vibrational and rotational energies of the molecules, heats up the material.


https://en.wikipedia.org/wiki/Inelastic_scattering


*

*absorption, the photon gives all its energy and momentum to the atom/electron, and ceases to exist. The atom gets a recoil (takes all the momentum).



The rest of the momentum causes the atom itself to recoil.

Where does the momentum go when atom absorb a photon?
A: I will hand wave how I understand what is mathematically shown here. 
Classical electromagnetic radiation is composed of photons. Photons are not described by the Maxwell wave equations that describe light. 
Photons are quantum mechanical particles, and are described by a wave function $Ψ$ which depends on the boundary condition problem on its mathematical form. In a medium this will be changing according to quantum mechanical scatterings of the photon with the various atoms of the medium, in this case a lattice since transparency is assumed.
The classical EM wave is a superposition/summation of zillion photon wavefunctions , and it is this total wavefunction that will give the $Ψ^*Ψ$ , the quantum mechanical description of the classical light wave.
Pictorially, one can think of the individual photons having longer tracks due to scatterings, so it takes them more time to get out of the medium. The confluence of photons still builds up the classical wave. Note that unless the medium changes the color of light, the photons do not lose appreciable energy/momentum  ( within the heisenberg uncertainty), it is the change in their direction that makes the slowing of the EM light they build up, they still go with velocity c in the vacuum as, for the photons, most of the space is empty.
You ask:

This sounds as if light knows of the medium ahead of it. So, how is there no time at all needed for the refractions to occur as light enters the medium?

If the confluence of photons after their scattering with the lattice would not build again a light beam, it would mean that the medium is not transparent. It is the mathematical positioning of the lattice atoms that allows for photon scatterings so that the beam builds up in the medium, but just with a velocity different than c  ( the photons always have c). In  quantum mechanics the solution is whole in this case the scattering of  zillions of photons on a lattice.
It is not the light that "knows" but it is  the mathematics of photons scattering on a transparent lattice.
