Roof ventilation may help control moisture in winter and remove heat from the attic, in the summer; and may also be useful in strategies involving convective stack ventilation (in hot climates) or to avoid ice dams, in cold climates.
Anyway, alone, roof ventilation will not solve thermal problems in the living space below the attic (see Box). And it all depends largely on climate and home design issues.
This page presents the different types of attic ventilation systems - soffit and ridge vents; gabble vents; roof-louver vents; attic fans... - and their effectiveness.
Roof ventilation can help control attic moisture and prevent attic overheating, in some climates. But though helpful, by itself it will not avoid thermal problems in the living space (below the attic).
To fix the problem you need a very airtight attic and very high levels of attic insulation (on the ceiling plane, preferably). That’s the best way to avoid heat transfer between the attic and the living space, and the thermal problems that come from it.
And the same is valid for other methods used to cool the attic area: 1) light roof colors, 2) reflective roofing, 3) roof coatings 4) radiant barriers (in hot climates).
Without high levels of attic insulation and airtightness none of these methods will make the rooms below the attic more comfortable.
See: Roof Cooling Guide
Soffit and ridge vents
Ridge vents are installed on the peak of the roof, along the roofline, end-to-end; they are typical exhaust vents.
They are designed to combine with soffit vents (or with under-eave and drip-edges vents…), installed along the soffit and eave areas.
Soffit vents and ridge vents should have special channels for air flow, called baffles (or rafter vents, or rafter baffles, or insulation baffles).
Baffles are cardboard dams, installed at the eaves, to prevent insulation from spilling out, or to prevent wind-washing. Without baffles, wind can blow insulation away from the outside walls (see image below, from Oak Ridge National Laboratory).
Ridge-soffit-baffle ventilation systems are the most effective attic ventilation systems, though also the more expensive, namely in roof renovations.
For an effective ventilation, consider a continuous ridge and soffit venting. The exact design vary a lot; a 50-50% ridge/soffit area is common, but recent studies are stressing the importance of putting more vents at the perimeter of the roof than at the top exit points (ridge). See: How much attic ventilation do you need
Gable vents vs. Ridge-Soffit ventilation: Advantages and disadvantages
Gable vents - typically a set of horizontal louvers - are installed at each end of the attic (gable). They are cheap and easy to install but they do not provide a good ventilation system and are susceptible to collecting snow and windblown rain.
They can cause more problems than they solve. In cold climates they may be a source of moisture and condensation problems. Avoid them in new construction.
Roof louver vents vs. Ridge-Soffit ventilation: advantages and disadvantages
Roof louver vents are very similar to gable vents, only mounted on the sloping section of the roof, typically near its peak.
They are outlet vents (like gable vents...) and are often used in conjunction with soffit vents. Without intake vents they will create dead air zones - a common cause of moisture problems.
They can be cheap and provide a wide venting area. But they have obvious drawbacks: they are prone to leaks (contrary to ridge vents) and in snowy regions they often become covered with snow.
They can be helpful in some hot tropical climates, in stack ventilation strategies, when inside air is exhausted into the attic (while breezes are captured in the lower parts of the building).
But they have obvious disadvantages in colder and mixed climates.
Solar and electric-Powered attic fans
Solar and electric-powered attic fans are designed to move hot air out of the attic.
By pushing overheated attic air to the outside, they cause outside air to flow through gable and soffit vents… The problem is that they can also suck air out of the living space into the attic, forcing air conditioning systems to work harder and increasing the cooling bills. Typically they consume more energy than they save.
They are rather ineffective, though popular and with mixed customer reviews and many misconceptions and wrong perceptions.