Most likely the second white and second black wires are the connection to the switch itself. If so, then what you've got is power line from circuit box to light, switch line from light to switch. (The alternate method is power line from circuit box to switch, switch line from switch to light - which would have been less confusing for you but he probably was dealing with old work by the sound of it.
How it works in your configuration (if I'm right) - imagine the electrical current like a flow of water. The power comes in from the breaker box on the black line (aka the hot line). The power then runs to the white line and down to the wall switch. When the switch is on it then runs back up the black line to the light. You connect black to black, and the power flows into the light, then out the white line. You connect white to white, and the power flows on down back to the breaker box, and out.
So - don't touch the second white and black. Just wire the light's white to the lonely white and black to black the same way.
What is probably happening here is you have power to the light on one black, another black to the switch, and a return path along the whites. That is, the switch is AFTER the light.
This is generally unsafe as the light is still energized, even when the switch is off, and should be fixed regardless.
The first thing I'd do is beg/borrow/steel a non-contact voltage detector.
With everything still attached, switch the light off. If I'm right, the detector would read hot on BOTH black wires, and the whites will be un-energized. Flip the switch and the whites should be energized as well.
If this is indeed the situation, the fix is relatively easy. Turn the power off! Remove the existing light.
Figure out which pair is wired to the switch. The easiest way is to use a meter in resistance mode. Find the black-white pair that shows low resistance when the switch is on, and open circuit when switched off. Mark the white wire with a loop of electrical tape. This will be the switched hot.
Now wire the blacks together with an appropriate wire nut, and make sure it's a secure connection. You should not be able to see any copper.
Wire the switched hot (the white wire marked with tape) to the black wire of the new fixture. Wire the remaining white to the white wire of the fixture. Make sure you've grounded the fixture according to the manufacturers instructions.
Mount the fixture, and turn the power back on.
Best Answer
The red wire should be the switch leg coming back from the switch.
The whites are all connect d so that appears to the neutral as it should be. Grounds are good. The two blacks should be one hot from the panel and one feeding the switch.
Take the switch apart and verify it is fed with a black and has the red on the other side of it. If so then connected your new light to the white and the red.
You should get a meter and verify your wiring if you are going to tpdo electrical work.
Good luck and stay safe!