"Bed of nails" has both literal and figurative meanings. A literal bed of nails is a long flat board the size of a bed with hundreds of nails sticking up. This bed is used for acupuncture treatment. Cambridge Dictionaries Online notes the figurative meaning as a difficult situation or circumstance.
Another use of the literal bed of nails is in physics or magic shows. The nails do not pierce the skin thanks to even weight distribution over the nails. Figuratively, a person might tell a friend struggling with a challenging relationship that he is "lying on a bed of nails," which is referenced in the Bon Jovi song "Bed of Roses."