Assuming you are talking about solar photovoltaic panels, the rails should be placed as close to the edge of the panel as possible. This allows for the most amount of light to hit the cells and be converted into electricity. The rails also need to be spaced evenly so that the panel is supported evenly.