There have not been any conclusive studies that prove that tanning beds are harmful to a baby during pregnancy. The UV light from the sun (or a tanning bed for that matter) don’t come in direct contact with the baby. However, the extreme heat of the sun could, in theory, be harmful to the baby or you, particularly in the last trimester.
The second issue to be concerned with is that your skin can be very sensitive and more susceptible to burn during pregnancy. For this reason, you might consider limiting your exposure to the sun, to avoid burns. Along this line, exposure to the sun might make you more prone to Chloasma, the dark splotches that can appear on the face during pregnancy.
During pregnancy you should be keenly aware of the risk of hydration. If you are tanning in the sun be sure to drink plenty of water, use of sunscreen with SPF 30 or more, and wear a hat. If you feel light headed, nauseated or tired, go inside.
Finally, you should consult with your physician before attempting to tan, whether it is in a tanning bed or in the sun. Your physician may be able to identify concerns that are specific to your case, and make a recommendation one way or another.