The most common way that two different rooftops join in a house is through a valley. Instead of creating a new, flat space the two roof lines meet at an angle. When you can, try to use a valley during your roof construction. Flashing is designed to protect a valley, shingles will be easier to overlap, sealing the edge is easier and moisture damage is less likely. Valleys should always angle down toward the ground to prevent any type of pooling water.
Connecting flat rooftops from two different levels of your home will be very difficult. A typical solution would be to run several boards of siding between the two rooftops and then use gutters and angles to make sure that no roof is dumping water onto another roof line. In this case, one roof will overhang the other, shorter rooftop. This helps prevent moisture damage that could result in trying to connect the two with roofing materials and provides another potential venting area.
Flat rooftops are not actually flat. Their rooflines are slanted so that water can pour off easily. If the two rooftops you are working with are near enough in height and have enough of a slant, you may be able to connect them using a traditional valley. These can save the hassle of adding in a short wall between the two roofs.
If you are still building the addition that is creating the flat roof problem, consider building it at an angle so that the addition can blend in with the original roofline. This is known as a skillion roof, a type of construction that merges two rooflines together into a seamless whole when an awkward roof may otherwise result. This can cost more money, but may be worth it in appearance and safety.