Mg-doped VO2 thin films with thermochromic properties were made by reactive DC magnetron co-sputtering onto heated substrates, and spectral absorption was recorded at room temperature in the 0.5 < ħω < 3.5 eV energy range. Clear evidence was found for a widening of the main band gap from 1.67 to 2.32 eV as the Mg/(V + Mg) atomic ratio went from zero to 0.19, thereby significantly lowering the luminous absorption. This technologically important effect could be reconciled with spin-polarized density functional theory calculations using the Heyd-Scuseria-Ernzerhof [Heyd etal, J. Chem. Phys. 118, 8207 (2003); ibid. 124, 219906 (2006)] hybrid functional. Specifically, the calculated luminous absorptance decreased when the Mg/(V + Mg) ratio was increased from 0.125 to 0.250.