Since this thread is off the road, past the fields, and in the river anyway . . .
Rack vs. wrack
Wrack is roughly synonymous with wreck. As a noun, it refers to destruction or wreckage. As a verb, it means to wreck. It is now mostly an archaic word, preserved mainly in a few common phrases.
Rack has many definitions, but the one that makes it easily confused with wrack is to torture. This sense comes from the use of medieval torture devices—called racks—on which victims’ bodies were painfully stretched. So, figuratively speaking, to rack something is to torture it, especially in manner that resembles stretching.
Common rack/wrack phrases
Rack [one’s] brain
Rack [one’s] brain is one common phrase in which rack in the torture-related sense is figuratively extended. To rack one’s brain is to torture it or to stretch it by thinking very hard.
To wrack one’s brain would be to wreck it. This might sort of make sense in some figurative uses, but rack is the standard spelling where the phrase means to think very hard. Wrack [one’s] brain is so common, though, that we have no choice but to consider it an accepted variant (some dictionaries agree with this).
In the phrasal adjective nerve-racking, rack is again used in the sense meaning to torture. Something that is nerve-racking tortures the nerves or figuratively stretches them.
Wrack, again, makes some sense, though. We can think of nerve-wracking as meaning wrecking the nerves instead of torturing the nerves, in which case the spelling is perfectly justifiable. But this doesn’t change the fact that nerve-racking is the original form, the more common one, and the one that is generally preferred in edited writing, for what that’s worth.
Wrack and ruin
The one common phrase in which wrack undoubtedly makes more sense is wrack and ruin, which is just an emphatic, somewhat archaic-sounding way of saying wreckage or ruin or, in other words, great destruction.
It’s hard to imagine a context in which wrack up would make sense. Rack up has several definitions, including (1) to accumulate, and (2) to prepare billiard balls for the start of a game.
The larger-font portion clearly shows I am very old, and so is my dictionary.