The picture helps a lot. The second white wire is coming from the switch, and it should have been wrapped with black electrical tape to indicate it was actually playing the role of a black wire. Determine which white comes from the switch, and that's the "black" wire.
Then the problem is as simple as connecting the new whites to the white wire, and new blacks to the black.
The following picture is what you have except on the light side, they have connected the black wires together and both whites are going to the lamp.
In order to determine which wire goes to the switch, you'll need a voltage tester. Turn off the breaker to the circuit and the light switch, and carefully remove the wire nut from the black wires in the lamp box. Be sure the wires are not touching anything, and turn the breaker back on. Using your voltage meter, touch the twisted black wires with one probe and each white wire going to the lamp. The white wire that shows 120v is the actual white wire coming from the breaker box. The other white wire will be the "black" wire coming from the switch. Turn the breaker back off and twist the wire nut back on. Be super careful when measuring the voltage with the breaker on.