Unless the photographer has expressly given permission for a photograph to be used in its entirety, reference photos (whether on the web or in a book) are there only to provide information and inspiration and should not be copied. Such as the characteristic shape of a particular type of tree, the texture of a rock, the colors on a butterfly's wings. An artist can then use this knowledge in their own compositions and paintings.
I think the distinction most people don't make is between using something for information (reference) and copying an image. There's a difference between using a field guide to find out, for example, how far the orange feathers on a particular species of bird extend down its chest and applying this information to your own painting of the bird, and copying the image in a field guide exactly, that is making a derivative image from one of the field guide's photo or illustration. If you're truly using someone else's photos or illustrations as reference, you're collecting information and applying it to your painting, just like you would apply your knowledge of color mixing.
A field guide is produced to help users identify things in nature, it's not produced so that artists can make derivatives from the photos. A book or website of artist's reference photos is produced with the intention that artists use them to paint from and will state so clearly.
I tend to think of it this way: if someone was shown the photo and my painting, would they say my painting was based on the photo? If the answer is yes, then it's a derivative use of the photo and not a reference use. If the painting is just for yourself, you can argue that no-one will ever know. But if you're selling paintings, that's a whole different game. My feeling is to always err on the side of caution, and to treat the work of photographers with the same respect and regard I'd want for my own work. Many people think it's just semantics, that all photos (especially those on the net) are there to be used. Or if you change 10 percent it's a new work (this myth varies in the percentage). But they'd squeal very loudly if someone used their paintings without permission e.g. as the background to a collage.
Many photographers are happy to give permission to use their photos. Others will want a fee. Ask before you copy a photo, or use a source that allows for derivatives. For photos you're free to use in artwork, check out these Artist's Reference Photos. Another good source of photos you can use for paintings is Morgue File, which provides "free image reference material for use in all creative pursuits".
Go to Full Artist's Copyright FAQ.
Disclaimer: The information given here is based on US copyright law and is given for guidance only; you're advised to consult a copyright lawyer on copyright issues.