It depends on the strength of the nitric acid. With dilute acid magnesium nitrate and hydrogen gas is formed. The gas reacts violently with a naked flame.
With concentrated nitric acid a violent reaction occurs and lots of reddish brown fumes of nitrogen oxides (NO and NO2) are produced.