Poets and authors establish atmosphere in the opening lines or paragraphs of a piece, though atmosphere can fluctuate and vary throughout a piece as the immediate objective varies within the larger, consistent, aim. Atmosphere, which is also called mood, is determined by the writer's choice of diction, description and setting. The purpose is to establish the emotional effect of the piece on the reader. On the other hand, the tone of a piece, is established through vocabulary alone. Tone contrasts with atmosphere (mood) because tone is the narrator's emotional feeling, the feeling with which the narrator talks about the topic or situation. A tone may be bitter while the atmosphere is haunting; or a tone may be sweet while an atmosphere is suspenseful, etc.
Diction is defined as the vocabulary choices a writer makes. For instance a crowd of people can be called a mob, a gathering, a congregation, a crowd, a gang, an assembly and so on. Diction is the way a writer chooses to express a thought that has many alternative options for expression.
Poets often use sounds in words, not just meanings of words, as a part of diction to create atmosphere (mood). In The Rime of the Ancient Mariner, the diction Samuel Taylor Coleridge employs ends each of the early atmosphere-setting lines with a prolonged vowel sound, such as in three, eye, me, wide, kin, hand, loon, child, etc. The diction choice produces an eerie atmosphere with one elongated sound following another, like a ghostly wail. The elongations of sound are capitalized upon by being preceded by plosives and fricatives like d p t th f st g, so there is a hurry-up staccato sound that freezes on the prolonged vowel sounds. What are some diction choices Coleridge makes that are related to meaning?
Description, another requirement of atmosphere (mood), is defined as careful sensory detail about a person, place, etc. Sensory pertains to the senses of taste, sight, sound, touch, smell (or others in SciFi...). In the first three lines, Coleridge establishes sensory detail of visual description with the words ancient, long beard and glittering eye. Waht other sensory words are noticable in the opening stanzas?
Setting is defined as location, historical time period and social circumstances of the poem, story or novel. It can be revealed through deliberate description [see above paragraph] or through narration or dialogue. Coleridge immediately establishes through narration the historical time period as being one earlier than his own by using archaic language as in the first stanza: stoppeth, thy, thou, stopp'st. The social circumstances are established in the second stanza in which the narrator tells us that he told the Mariner of a bridegroom, a feast and being next of kin. From this we know that the speaker is on his way to a wedding and has been waylaid by the ancient Mariner before the open doors of the feast hall.
It is through the incorporation of these elements that Coleridge creates the atmosphere (mood) of The Rime of the Ancient Mariner. While atmosphere (mood) is established early on in the text, the choices of diction, description and setting carry on beyond the first few lines, so there are other examples that you may be able to pinpoint on your own. Bear in mind that atmosphere may change, as it does in The Ancient Mariner, to create new transient atmosphere effects as the writer desires for impact and/or variation.