Lenz's Law. As magnet with South pole is moving upwards, the solenoid will tend to create a magnetic field with the South pole downwards to PREVENT the magnet from cumming into him. Right Hand Grip rule, you point your thumb to the ceiling (up) and your fingers will wrap around anti-clockwise...