The green flash appears in the raft when Robbie is sad about another day without food, or water, and she was watching the sunset when she sees it. She was very excited because she ha never seen one before.
I think the author included the green flash in The Raft, because Robbie was having a bad day thinking about how she had to kill the seal, and how she had gone another day without food, and water. They included it because it made Robbie's day better, and it told her they there would not be any rain the next day.