Bro, I'm not trying to flame but I've never seen a fair study comparing the two, and have heard that, the amount of tan obtained being equal, a quality tanning bed is in fact safer.
The only way to compare the two would be to use two huge study groups comparing similar skin types and comparable amount of UV exposure (IOW not comparable times exposed to each type). To my knowledge such a study doesn't exist.
Much of the empirical evidence available centers around the fact that in the general population tanning bed users probably average probably 2 to 10 times more UV exposure than those who don't use beds. (In fact, most adults get so little exposure to natural sunlight that my understanding is that the average person spends more time in the sun during their childhood than the next 50 plus years of life.) Also, most of the evidence cited doesn't seem to take into account that there is any benefit at all to UV exposure.