Is reflection and refraction the same thing - bouncing of light? I've been trying to wrap my head around what determines whether a ray of light is being reflected or refracted. A beam of light does both, as shown in this picture.
http://sc663dcag.weebly.com/uploads/2/4/1/1/24110261/8991488_orig.jpg
But a beam of light is made out of multiple photons or waves. 
1) So what about each individual photon; does the photon split into two, and one half is reflected while the other one is refracted?
2) Or does some photons reflect and some refract, and if so what determines what happens to which photon?
3) Or is it that photons just bounce of in different directions, some are bouncing away from the material causing reflection and some are bouncing into the material and thus causing refraction?
Well actually photons don't really bounce, do they, like ping pong balls bouncing of a basket ball? Photons are absorbed by an electron, exciting it to move to a higher energy level and then releasing that same energy again when falling back to it's ground state. But is this re-emission happening in random directions, sometimes away from the material and sometimes into the material? But if so, wouldn't that cause very diffuse reflections and refractions if just all photons bounce off in all random directions. This isn't happening, so what makes sure that the angle of reflection is the same as the angle of incidence (also viable in the image above)?
If an electron is absorbing a photon while it is circling around its atom, and then releases it again at a later time, then the electron isn't in the same position as is were when absorbing the photon, so how can the electron "know" what the angle of incidence was so that it can release the photon in a new angle that becomes the same as the incidence angle was at the time of absorption . . . that makes no sense, does it?!
What am I missing here? :)
 A: This is one of the places where wave particle dualism gets some people in trouble.  Many are taught that it means that light can be a wave and a particle, and that phrasing can lead to some confusion.  I find it more intuitive to just rip the bandaid off quickly and say light is neither a wave nor a particle.  It is something which, in some situations, can be well modeled as a wave, and in some situations can be well modeled as a particle, but it is its own thing (which can be well modeled in all known cases using a more complicated concept, a "wavefunction").
You can think of photons getting randomly reflected or transmitted on the boundary, but the truth is that the billiard-ball photon model really isn't very effective at describing what happens at this boundary.  This is one of the regions where wave mechanics models the effects very well, while particle models don't do so well.  If you use wave mechanics, the idea of a wave getting partially reflected and partially transmitted isn't difficult to believe at all.  In fact, it's pretty easy to prove.
Thinking in wave terms at these boundaries also gives correct answers in peculiar situations where the particle model simply falls on its face.  Consider the interesting case of an "evanescent wave."

In this setup, the laser and prism are set up at the correct angles to cause "total internal reflection."  This means that, by the simple models, 100% of the light should bounce off the side of the prism and into the detector.  Indeed, if the prism is in the open air, we do see 100% reflection (well, within the error bars of absorption).  However, bring an object close to the prisim (but not touching) and things change.  You end up seeing effects from the object, even though 100% of the light was supposed to be reflected!
If you think of light like photons, this is hard to explain.  If you look at it as a wave governed by Maxwell's equations, you see that you would violate the law of conservation of energy if there was a "pure" reflection.  Instead it creates a reflection and an "evanescent wave" which is outside the prism, and its strength falls off exponentially, which is really hard to explain with particles!
Of course, these too are all simplifications.  The real answer to your question is that the wavefunction of the light interacts with the electromagnetic fields of the atoms in the prisim, and the result of that interaction leads to reflection, refraction, diffusion, absorption, and eveansecent waves.  However, naturally those equations are a bit harder to understand, so we use the older, simpler models from before quantum mechanics.  We just have to be sure to use the one which is most applicable in any given situation, because none of them are quite right.
A: 
what determines whether a ray of light is being reflected or refracted.

While going from one medium to another there are three possible actions of photons:


*

*The beam gets reflected. The photon has momentum and some part of this momentum over goes to the medium and the re-emitted (reflected) photon has less energy content and it's wavelength is red-shifted.

*The beam goes into a denser medium and the photons moves with less the speed of light for vacuum through this medium. By this the photon gets bended (refracted).

*The beam goes into a less densely medium and the photon moves with a greater speed than in the denser medium. by this the photon gets refracted in the direction opposite to case 2.


Usually case 1 and 2 as well as 1 and 3 are taking place commonly.
Some theoretical facts
Any beam of light consists of photons (this easily to be seen if one investigate about the production of light, which happens always from excited subatomic particles).
Photons are indivisible quanta and couldn't be divided during their live between emission and absorption.
For reflected photons the incoming and the outgoing angles are identical. This is used in reflecting telescopes which haven't any chromatic aberrivation.
For refracted photons - like in this prism the refraction angle depends from their wavelengths:

But the photons wavelengths stay the same and the photons are not splitted into a refracted and a reflected photon.
Your assumptions
So your first guess

what about each individual photon; does the photon split into two, and one half is reflected while the other one is refracted?

is not right.

does some photons reflect and some refract, and if so what determines what happens to which photon?

Perhaps you know that photons have an electric field component an a magnetic field component, both perpendicular to the direction of propagation and to each other. I'll focusing on the electric field component, but everything now being said is right for the magnetic field component too. The direction of the electric field of photons from a thermic source (light bulb, fire, ...) is randomly distributed around 360°.
Dependent from the angle at which the beam is directed to the prism, more (or less) light is going through the prism and less (or more) light es reflected. It was found that the two beams are polarized. Means, the electric field of the photons has a preferential direction.
Polarization of light
What happens to the photons? Using polarized light you will see what happens. Rotate the direction of polarization and you will see that at one moment the light gets more and more reflected and 90° later it gets more through the prism. So the direction of the electric field of the photon determines the behavior of the interaction with the prism.
A: You ask how an individual photon "decides" to reflect. (These are Feynman's words, page 24 of QED.) Feynman says we don't know. Newton also speculated on this very question in 1704, so you can see very little progress has been made!
RF guesses that the question has no meaning but doesn't elaborate. All he says is that we are stuck with calculating probabilities. That's it! (see page 18-24 of QED for this discussion) 
That's not a very satisfying answer, at least to me. What you are left with is non-deterministic science, calculating odds like a bookie at a race track. Well, not quite that bad, since we know exact probabilities. But probabilities all the same. 
Spooky stuff, at heart.
A: 1) This is incorrect. Photons cannot be split, energy is quantized.
2) This is a little more correct. Not fully correct, but thinking along these lines will give results that make a little more sense. A more complete picture is as follows.
When a single photon impinges upon the boundary it goes into a quantum superposition of having refracted and having reflected. That is when you perform a measurement of which way the photon goes, R% of the time you will see it reflect and T% of the time you will see it transmit into the medium and refract. One might say that the photon is in a superposition and the measurement collapses system into either the state of the photon reflecting or the state of the photon refracting.
When you perform the experiment with 10^16 photons it looks like T% of that beam goes one way and R% goes the other.
I'll point out that there are no issues with energy here. In each term of the superposition there is just a single photon going one way, so whichever outcome is observed in experiment is consistent with the incident single photon's worth of energy.
3) This question is all over the place. You are asking about a microscopic picture of reflection and refraction.
Classical physics answer: The electromagnetic field drives electric dipoles in the material. These dipoles modify the incident field and also radiate their own fields. However, since dipoles at different locations are driven by the same electric field their oscillation is coherent. This means the emission of a dipole from the top part of the beam (looking at your image) can coherently interfere with the emission of a dipole from the bottom of the beam. This interference is constructive for two situations. 1) a reflected beam 2) a refracted beam. Question: why doesn't the beam reflect at a different angle? Answer: the interference of the electromagnetic field from the dipoles and incident field at those points in space is destructive.
Quantum physics answer: The atoms in the material absorb the photons, but since they are driven by an electric field they coherently undergo stimulated emission so that their emission pattern (a superposition of photons going many different directions) can undergo coherent spatial interference. Resulting in destructive interference for all cases except the photon reflecting or refracting.
