The wording of this question can turn the meaning around completely. Let's look at the right question and the wrong one. I see it being asked too many times, so hopefully I'll set this right for some people.
The wrong question: Why is the sun burning in space?
Outer space has no gasses in it. Thus there is no pressure and a person without protection would experience his blood boiling, extreme cold and possibly his less protected areas popping out of his body. But that's beside the point. No gasses means no oxygen or any other oxydiszng agent for that matter. Thus, nothing can combust in space. Therefore, the sun is not burning.
The right question: What causes the sun to emit heat and electromagnetic waves?
Well I'm not that good with words. Basically, the sun is not burning. A complex reaction called fusion is constantly occuring deep at it's core. At one point it it's life, the Sun was nothing more than a cloud of hydrogen gas. Somehow a few hydrogen molecules got together, they formed a gravitational pull, pulling in more and more molecules. Eventually the ball was so heavy that the pressure at the core caused two Hydrogen molecules to fuse. What followed was a sight that not even holywood special effects artists can portray. The Sun lit up like a christmas tree and started fusing hydrogen atoms to form helium. This reaction is egzothermic, meaning it emits heat, which is basically a certain wave in the electromagnetic spectrum.
Now our Sun is forming heavier elements like oxygen and nitrogen in itself. When it's life time comes to an end, the Sun will explode in a supernova, releasing all the elements out into space, where they will gather together as dust and maybe, one day, form another planet, perhpas even similar to Earth.