Ray space "Riccati" evolution and geometric phases for N-level quantum systems