  We explore sources of ionization of diffuse gas at different altitudes in
galaxies in dependence of their stellar mass, \Ha\ luminosity, and specific
star formation rate. We use the MaNGA data from SDSS-IV data release DR16
together with photoionization and shock ionization models provided by the 3MdB
database. Our sample comprises 239 edge-on galaxies, which makes our results
statistically valuable. We reach very high galactic altitudes with the help of
spectra stacking. We demonstrate that models of the gas photoionization in a
combination of young OB-stars and hot low-mass evolved stars (HOLMES) describes
the gas ionization state in the galaxies of all types on diagnostic diagrams.
Nevertheless, the shock waves may contribute to the gas ionization in massive
galaxies with passive star formation. We observe a general trend of decreasing
the fraction of the ionizing flux from OB-stars and the ionization parameter
with the altitude, while the role of the ionization by the HOLMES increases.
The biggest difference in the contribution from these types of ionizing sources
correlates with the specific star formation rate and with stellar masses of
galaxies. The HOLMES are the principal gas ionization sources in massive
galaxies with passive star formation, while OB-stars dominate the gas
ionization in low-mass galaxies with active star formation.
