In visual media like film or television, it is easy to set the atmosphere: lighting, set, props, character reactions and even music can project the desired mood to the audience. In writing, atmosphere needs to be created using only words. One effective way to learn how to establish a well-written atmosphere is through practice: the more scary atmospheres you write, the better they will get. One general rule to follow when setting the atmosphere of your writing is to show, don't tell.
Keep it realistic. The scariest horror stories and movies are the ones based in reality: they scare us because we can imagine it happening for real. Keeping a sense of realism in your writing will go a long way to scaring your audience, and the the sense of realism will help them to picture the scene you are trying to set.
Describe the sensory input from the scene. This is part of the show, don't tell rule: rather than explaining that an abandoned house has creaky floorboards, describe the creaking noise as your characters move through the house. Use adjectives to round out descriptions of sights, sounds, or even smells.
Write about your characters' physical reactions. Instead of telling your readers that your protagonist is scared, describe how her pulse is racing or her hands feel clammy. Once again, the trick to effective writing is to show, don't tell.
Use expressive, spooky vocabulary. If you are stuck for descriptive phrases to illustrate your setting and atmosphere, brainstorm eerie-sounding words. Think of things you are afraid of; chances are, someone reading your work will share the same fears.
Read your scene aloud when you finish. Try it out on a test audience such as a friend or family member. They can provide feedback and advice on how to improve your scene, if necessary. Don't be afraid to go back and edit what you have written; most writers go back and rework what they have written several times before they are happy with the outcome.