dost is actually masculine word so it means friend(m), but now a days i find people using this word for female as well, although technically wrong but whatever people say become right, one of examples for it is song's line from a movie which says 'tu hi to MERI dost hai', how it can be 'meri dost' when dost is 'm',
dosti is friendship with no gender string attached to it,
yaar means friend(technically m, but dont worry present usage is m/f both), but its day to day life usage isnt so easy to tell that it may not sound awkward, i can still remember 7-9 years back, there were articles published in newspaper in which author was concerned about misuse of word yaar, because we may use it virtually anytime, also i can remember my mother being strict not to use yaar, when girl used it as, as per her it was sort of a boyish catch phrase(of course not at all offensive, but still may be something about it sounded bad to her), but as time has passed, now this isnt any issue, no more objections, no more articles, but still i find girls use it less often in our side, so i suggest u to avoid it and not to use it as per ur own convinience, it may sound awkward. Or just listen to day to day converstion, u will get good idea when to use it when not to.
But Yaar can be used for closer friend without doubt