As the second letter of a two-vowel pair, Y follows the double vowel rule, i.e.1 it is silent, but makes the first vowel long. These are most often found at the end of common root words.
When Y precedes a vowel it is usually a consonant at the beginning of a word (yard, yes, yesterday and yam) or a coincidence created by a compound word (anyone, bellyache and payable) or suffix (betrayer, employee, buoyancy and surveyor).
Most of the time a vowel Y is used in common words it represents the A, I or E long vowels. Of course English is by no means consistent, so there are some special cases. Two-vowel Y is easiest to explain as a chart. [click here for the chart of Double-Vowel Y]