Gas formation and detection methods