Tanning safer in tanning bed or sunlight?

Which one is less likely to cause skin cancer and other conditions?