Don't drink anything while reading this.
The act itself is familiar to anyone who's ever watched comedy: One character takes a swig or bite of something just as another character says or does something shocking or outrageous, causing the first character to spew out the contents of his or her mouth. It's called a spit take, 笑喷 (xiào pēn) in Chinese.
Spit take is an act of suddenly spitting out liquid one is drinking in response to something funny or surprising:
'Spit take' originated as a showbiz term, but it's increasingly seen in general contexts.
tā shuō nà xiē huà shí wǒ zài hē dōng xī, wǒ kěn dìng xiào pēn le
If I'd been drinking something when she said that, I'd have done a spit take
Source: China Daily