The solar panels should never be flush with the roof. This is because, on very hot days, the heat generated can leak through to your attic and cause it to overheat. Therefore, most manufacturers recommend a gap of four inches between the panels and the roof itself. The gap between the last row of solar panels and the roof's edge should be a minimum of 12 inches or one foot. This ensures the panels are. It is best to leave four to seven inches of space between two solar panels. Again, this accommodates the solar panels' expansion and contraction. Flexible solar panels are used on cars, RVs, boats, and so on, and they are sometimes installed directly onto the surface of these devices. The gap between solar panel rows should be around five to six inches, but it is also recommended that you leave one to three feet of space between.