Gas can sometimes be caused by underlying health conditions. To determine the cause of gas, your doctor may perform a physical exam and review your everyday habits/diet.