Two people were killed and another two injured in a shooting at a California state beach, authorities said.