If you can get a blowtorch on the nut then that will definitely shift the rust. Undo it when the nut is red hot and use a socket set, preferably a single hex (6 sides, not 12) socket. Ring spanners are a second best but don't bother with an open ended spanner - it'll just round the corners of the nut.
If getting the nut red hot might damage other stuff then heat it up as much as possible and then put some heavy-ish oil on, old style 20/50 engine oil is ideal. Don't use WD40 as this will just evaporate without doing any good - the engine oil will thin down nicely and penetrate (ooh Matron) the threads. If necessary repeat the heating/oil procedure a few times.
When you come to undo it DON'T try to unscrew immediately. Give the spanner a slight tightening motion to break the bond between the nut and bolt and then try to unscrew a bit. Keep rocking back and forth gradually working the nut loose.
You'll get it eventually.