The poem's speaker goes out for a walk along a mountainous coast one evening in an attempt to clear his head. He's feeling anxious, "[u]nhappy about some far off things / That are not my affair." In other words, he's worried about global events that he has no real control over. (Jeffers wrote this poem at the start of WWII, and the following stanza alludes directly to the conflict.)
As he walks "the lean ridges," or narrow hilltops, the speaker looks out and sees "The stars go over the lonely ocean." This phrase will be repeated throughout the poem, becoming an important refrain. The stars and the ocean contextualize the speaker's situation, as well as that of humanity as a whole: compared to the immensity of the universe, humanity's problems suddenly seem quite small.
The speaker also personifies the ocean here by calling it "lonely." That loneliness suggests that the scene is quiet and empty. At the same time, the speaker is likely projecting his own emotions onto the landscape (an example of pathetic fallacy). That is, the ocean's loneliness reflects the speaker's sense of isolation from the rest of humankind. The long, round assonance of "go over the lonely ocean" evokes a moan or cry of pain, reflecting the speaker's downtrodden attitude.
The poem's formal traits help to further convey the speaker's state of mind. Though each stanza has a similar shape on the page, there's no strict meter here; the poem never quite settles into a regular, predictable rhythm. Enjambment adds to the sense of restlessness, delaying the arrival of the stanza's main verb ("saw") until line 4:
Unhappy about some far off things
That are not my affair, wandering
Along the coast and up the lean ridges,
I saw in the evening
The stars go over the lonely ocean,
The poem, like the speaker, seems to "wander" down the page, searching for something without knowing what that something is. The first five lines thus create a quiet, if troubled, atmosphere, luring the reader into the poem's mountainous and almost mythical world. Nothing's really happened yet, but it's out of this hush that the mystical figure of the boar will emerge.