The present chapter explores how immersive virtual reality (VR) systems can be used for pain research and treatment. Pain is a universal, yet entirely subjective and multifaceted unpleasant experience. One of the earliest VR studies on pain highlighted the role of attention in pain modulation. However, the role of body representation in pain modulation has also been described as a crucial factor. Through virtual reality systems, it is possible to modulate both attention to pain and body representation. In this chapter, first we define how immersive VR can be used to create the illusion of being present in immersive VR environments and argue why VR can be an effective tool for distracting patients from acute pain. However, distraction seems to be less useful in chronic pain treatment. Chronic pain can be highly disabling and can significantly impact not only the sufferer's quality of life, but also their perceptions of the bodily self. Close neural connections between the body matrix and pain open a chance for influencing pain through bodily illusions. This chapter explores approaches to inducing body ownership illusions in VR and discusses how they have been applied in pain research. The present chapter also covers a set of practical indications and methodological caveats of immersive VR and solutions for overcoming them. Finally, we outline several promising future research directions and highlight several yet unexplored areas.