I have had the best results painting the rail after inserting it in the ties and bending to shape. Just hold can at a low angle and spray from the side. No problem if you spray some on the ties, just gives them some needed weathering. I get a nice rusty color by spraying a base coat of red oxide then spattering on a light coat of flat black and grey primer. Paint doesn't stick well to aluminum and will start flaking off in 2 to 4 years. Might get better adhesion if you wash the rail in your bathtub with some soap and water, then soak it in some vinegar water, then air dry thouroughly, but that is too much bother for me. Rubbing some candel wax on the side of the foot of the rail makes threading the rail in the ties alot easier but of coarse doesn't help holding the paint.
Terl