Is an artificial tan safer than the real thing?

Sunless tanners work for the same reason a steak turns brown.