LM339N comparator won't work
simulate this circuit &ndash; Schematic created using CircuitLab

The above circuit should work(1)- the output as others have said is open collector so it can only sink current and not source it. You could also put the LED in series with R1 but it would be off (rather than on) when the output is high- so you could just swap the inputs. 

(1) It is important that the common mode range of the LM339 inputs is respected. It is given in the datasheet as 0V to V+ - 2V so if the supply voltage is 10V, neither input should be above 8VDC or below ground. In fact with this particular comparator it will function provided at least one input is within the common mode range, so when the LDR is very dark it will function provided:

\$V_+\cdot \frac{R2}{R2+R4} &gt;= 2.0\$