How can you bake lighting? I want to bake in blender cycles but I get black images. I tried it with different blender versions and different settings (combined baking or just shadows). My setup is a plane and a cube which are both UV unwrapped.

I can apply images and textures just fine, but when I create a new image, connect it to the diffuse node of the cube and plane material, then choose the new image and then bake everything is black whether I am in textured, material or rendered mode. I have 2 lamps which are just fine in rendered mode so thw problem can not be the lighting.
Most probable reason of your failure, is connecting texture image node with new image to shader node of the cube. Notice, that when you try to bake, you get message "Circular dependency for image "YourImageName" from object "YourObjectname". The texture image node in material (for each material) of the object from which you want to bake a texture, must be active (selected as last) but not connected to any shader, connected to material output.It should look like this: