What is your goal with adding a roof, sun protection, enclosing the space to feel more like a room? I have seen lattice and fabric added to shade a pergola. At our old house we added additional boards to the top of the structure to offer more shade during the later hours of the day. Here is the link to some images of the finished project.
Comment back on what your looking to achieve and I can try to help you more.
Cheers! Lauren - The Little Lake Cottage
Here is one way: http://myfrugaladventures.com/2015/01/how-to-build-a-pergola/
You can staple and drape outdoor fabric on the top. It will not be waterproof but it will give you shade. Another thought is metal roofing.
Assuming you know that the pergola is sturdy enough to hold the weight and wind resistance of a roof, you could easily screw on a corrugated material like this. (click to go to link with roof) It's available in clear, nice to let in light but not rain, or if you're trying to block light, it comes in opaque colors too! :)