The higher the sun gets (the further west it moves), the "sooner" will its journey be over, because it's "nearer" to "setting."
The speaker calls the sun a "glorious lamp" because it gives off light.
"A-getting" is just an older or poetic way of saying "getting."
The sun isn't actually running a race; "race" can mean "journey, voyage, path."
The progress of the sun through the sky, which is how we measure a day, recalls the first stanza's discussion of "today" and "tomorrow.