As a verb, rack means "to afflict," "oppress," "torment."
To wrack is to cause the ruin of.
A lot of people mistakenly write things like "nerve-wracking" and "I wracked my brains." Drop the w in both cases. Both expressions derive from that device in the torture hall of fame called the rack.