How does a non-infinite monochromatic plane ray of light know which way to refract? I have been making a simulation of light traveling in medium from classical physics perspective and while trying to makes sence of a traveling wave packet i realized i don't understand something very fundamental.
Left side of the image:
Nothing to it, we know which way a light ray will refract/reflect from Snell's law and Fresnel's equations, both of which we can get from Maxwell's equations and border conditions.
Right side of the image:
Googling about ultra short laser pulses I've read that dispersion becomes a big problem. A short pulse of light is by it's definition made of different frequencies, so no problem there, the medium "will do" a Fourier analysis of the light and send them in different directions.
Question:
This means, that a short pulse of light will refract in different directions but a long pulse of light (which are basically a bunch of short pulses one after another) will not. How does the medium know how long the pulse will be? 
If it's a short pulse of light it seems to disperse it, but if it's long it just sends it in one direction. How does the medium/light "know" what to do? 

 A: As long as a physical phenomenon can be approximated using a linear partial differential equation, Fourier analysis works to describe it.

A short pulse of light is by it's definition made of different frequencies, so no problem there, the medium "will do" a Fourier analysis of the light and send them in different directions.

But the medium doesn't actually "do" a Fourier analysis, right? It's just a convenient way to look at it mathematically. So it actually doesn't matter how the incoming wave looks like.
Assuming linearity, it's exactly the same for a soccer/football player hitting the ball. Some momentum goes from the foot into the ball, some gets reflected back into the foot. This could also be described by a Fourier transform of the foot movement and the ball movement. In that case, we prefer looking at it without the fourier transform because it's easy to imagine it. On contrast, we usually imagine light as a wave because we aren't "used" to a single pulse.
So I think this issue is about accepting the following:


*

*a physical fact: a lot of phenomena can be described with linear approximation.

*a mathematical fact: a linear approximation can be described with Fourier analysis and plane wave is just as valid as a pulse (they are equivalent perspectives, a mathematical fact).

A: It is not correct, quite, to say that a long pulse if light is the same as a lot of short pulses.   
A short pulse is, indeed, equivalent to the superposition of a continuum of discrete wavelengths, each of which, in isolation, is infinitely long.  The individual discrete wavelength components of two pulses overlap and they interfere.  They can reinforce one another or cancel each other out, depending on the time spacing between the two pulses.  Same goes for a lot of pulses.
In the situation you describe, a long continuous pulse would amount to a lot of short pulses spaced very precisely apart in time: equivalent to one cycle of the central frequency.  The wavelength components of the short components would cancel unless they were very close to the central wavelength.  That leaves only the central wavelength in the beam, so light exits in one direction and with one wavelength.
