The work described here originated from the tragic and ultimately environmentally catastrophic event at the Macondo well in April 2010. The first part of the paper addresses the causes for the sudden and often destructive ejection of hydrocarbons from a riser when a gas kick escapes timely detection. The approach differs from previous work on the subject and provides a realistic understanding of the sequence of events responsible for the phenomenon. The focus is on the crucial few minutes and seconds prior to the sudden eruption of gas and provides a quantitative illustration of the extreme rapidity of the ejection which leaves no time for a drill crew to adopt mitigation measures. It is shown that, in many cases, a back-pressure applied at the top of the well can be beneficial. The second part of the paper describes a novel method for the detection of gas which relies on the measurement of pressure differences along sections of the riser. These data are sensitive to the mean density of the fluid in the section and can therefore detect the presence of free gas. Laboratory experiments supporting the idea are described. Proper signal processing can be developed which may be able to allow for automatic mitigation measures to be taken in the event of an otherwise undetected gas influx approaching the surface.