The Earth's magnetic field has a North-South polarity.
By convention, the North pole of a magnet is attracted to the South pole of the Earth's magnetic field, and vice versa.
Since the North pole of a compass magnet points towards the geographical South pole (the Earth's magnetic North pole), the North pole of the compass aligns with the magnetic field lines towards the geographic North pole, which is along the lines of the magnetic field.
Thus, the correct answer is (b).