Scientists spotted patterns hours before a major solar flare, a discovery that could help forecast dangerous eruptions.