First, to make things easy on yourself, get a level line where the bottom of the beam will mount to the post. (did I read your message correctly? The beams are being attached to the sides of the posts?) Below this line, nail up a 2x4 block vertically on the 4x4 post so you can rest the beam on it. When you have the beam where you want it, you'll put a few nails in to hold it there.
You can just run the 16 foot beam to the center of the middle post. (i.e. overlap the post by 1.5 inches) The other beam needed to span the remaining 11 feet can be attached the same way. In other words, the two beams can share the middle post, with their ends butted up against each other. Then, bolt those beams onto the posts - using two lag bolts (and washers) per post -> 3/8" or 1/4" diameter bolts should be fine. They should be 4.25" long (one and a half times the thickness of the thing you're bolting, which is a 2x8? -> 1.5 inches thick.)
Are you putting a beam on each side of the post? (i.e. the beams will run along the posts like parallel rails.) You'll get some extra support if you do.
-Hope that's understandable and helpful. (Easier done than said.)