Sometimes the pipes rattle when the water runs through them, and can be fixed by locating the section and either relieving the stresses from the expansion and contraction or by strapping them more rigid. Sometimes the pipes rattle because the gasket in the toilet bowl filler is bad and is sending out harmonics through the system causing the pipes to shake. This can be fixed by replacing the offending ball cock. You can find out, by lifting on the ball cock float when you hear the noise. If the noise stopps, then the problem is the ball cock. If the noise doesn't stop, it could be either expansion and contraction or rattling.