There are several ways to fix it. The very best way is to replace it. If you don't want to remove and replace the rails, then the only option is to add metal. The questions are where, what, and how? I would consider 3/16" angle iron over the top and sides of the rail. I don't know the size from the picture, but lets say you have a piece of 2" x 4" x 3/16" angle iron, you could place it over the area to be reinforced ( after you coat the rusted area with a proper rust preventative paint along with the inside of the angle iron that is going to reinforce it). Don't paint the immediate area where the welds will go, or just grind them clean before you weld. The reason that I say this is that you can't get in there later and it will rust between those two pieces of metal, especially if salt gets in there. Before you put the structural reinforcement on the outside, you need to make sure that you can allow for the thickness difference when you put the shell back on. If you have to put the reinforcement on the inside, it makes it more difficult since the channel that is rusted has a radius that has to be dealt with. I would weld the verticals 100% and probably do 2" on 6" center welds for the horizontals, top and bottom.
Once the replacement and repairs become extensive it is actually easier, faster and cheaper to build a new frame out of structural channel. I think that yours can be repaired, if done properly.
Let us know what you decide.