Steam Family Sharing only allows you to play the game if the owner of the game's account the game is actually purchased under isn't active. So It counts as active if someone elseanyone is in that account - not just theplaying any game you want to play, but the account that it's under as well -in it.
So if...
- the account owner is playing any game they purchased, not just the one you want to play
- Anyone else they're sharing with has already "borrowed" a game from their account
...it will prevent you from starting theany game in their library. So When it's locked like that, it presents the "Buy" button option instead when this happens, like you saw. When the account is free again, basically - when that user stops playing whatever game they are in now, - you will see a Play button again.
There are some games that just can't be shared at all due to needing additional registration and accounts apart from Steam, but those will not appear in the shared library at all. So you wouldn't be able to download or install them in the first place (checked this against The Secret World, it doesn't appear at all when the account is shared).
(edited to include additional information from comments, thank you Keavon, Ismael Miguel, James Thorpe, & Ben Jackson)