What does "share a type rating" mean?
If two aircraft (let's call them Aircraft A and Aircraft B, since this isn't specific to 777/787) share a type rating (technically known as a "common type rating"), it means that, if a pilot is already certified to fly Aircraft A, and wants to get certified to fly Aircraft B, they only have to take a course on the parts of Aircraft B that are different from Aircraft A.  If Aircraft A and Aircraft B didn't have a common type rating, an Aircraft A pilot wanting a certification for Aircraft B would have to train for every part of Aircraft B, even if many, or even most, of those parts were exactly the same as on Aircraft A.

As you can imagine, getting two (or more) aircraft types a common type rating can save quite a lot of training time and money for pilots switching from one to the other.

Grossly-oversimplified example


Our aircraft:


Aircraft A is composed of parts A, B, C, D, E, and F. 
Aircraft B is composed of parts A, B, C, G, E, H, and I.

Our pilots:


Grace is certified to fly Aircraft A.  She wants to become certified to fly Aircraft B.
Tedd is certified to fly Aircraft B.  He wants to become certified to fly Aircraft A.



Scenario 1: Aircraft A and Aircraft B do not have a common type rating


To gain certification for Aircraft B, Grace has to take courses on parts A, B, C, G, E, H, and I.
To gain certification for Aircraft A, Tedd has to take courses on parts A, B, C, D, E, and F.


Scenario 2: Aircraft A and Aircraft B share a common type rating


To gain certification for Aircraft B, Grace only has to take courses on parts G, H, and I.  She doesn't have to take courses on parts A, B, C, or E, since those parts are the same as on Aircraft A, which she's already certified on.
To gain certification for Aircraft A, Tedd only has to take courses on parts D and F.  He doesn't have to take courses on parts A, B, C, or E, since those parts are the same as on Aircraft B, which he's already certified on.


Real-world example

The A330 and A350 share a common type rating (but the A340 doesn't, because different number of engines); as a result, whereas (say) a 767 or A300 pilot wishing to gain A350 certification needs 23 days of comprehensive training on every aspect of the A350, an A330 pilot has to take an eight-day course to become an A350 pilot.  This eight-day course, covering only the parts of the A350 that differ from their counterparts on the A330, is, appropriately enough, termed "differences training".  (Source)