Assuming you are referring to exterior of the barrel. It will depend upon the finish and how bad the rub marks. Are you asking about blued, stainless, nickel or some other type of finish? If it is a semi-auto pistol, a light preventive coating of grease helps prevent rub marks due to the slide in many cases.
How about a picture of your issue?