On my file is already done!

Link a bulb lamp to a transistor and the transistor with one of your arduino's pin..

Create a circuit with a 2K resistence and a fotoresistence, this is useful to read the voltage in the connection of two resistence..

Done..! The lamp turns on in the dark!

I did analogRead from fotoresistence and then analogWrite to transistor!