At sea flying to the ship (frigate) one night, we hover alongside the deck waiting for a response from the FDO - nothing, so I decide to move forward to abeam the bridge to draw their attention to our presence. At the same time, unbeknown to us, the Captain told a seaman to go and fire a green flare from the port bridge wing. It just missed us...