Market gains for second day in a row