There are some pitfalls to wearing both hats. The writing community, especially the indie writing community, is very connected, and there's some expectation (even if it's only in my head) that I'll review my friends' stuff positively.
I don't always do that. I say what I think. So far I haven't hit anyone like the guy described in this post on Making Light, who responded to a negative review from another author by trashing her book in revenge. (Pro tip: don't do that.) The people I choose to hang out with are sensible adult human beings and they will take a less-than-raving review in their stride. But I try to make it easier for them (and for authors I don't know) by following a few important principles.
Actually, of course, reviews are not primarily for the authors' consumption. They're for other readers. I know I appreciate reading a review that warns me about the weaknesses of a book, so that I can assess whether they are likely to spoil my enjoyment or not, and alerts me to its strengths, so that I can decide whether that's a thing I like or not. And this is why I write reviews the way I do.
Here are the principles I try to follow. They're a work in process and I don't guarantee that every review I've written, or even every review I've written recently, follows them perfectly. But this is what I'm trying for.
(This post, incidentally, was partly triggered by Lindsay Buroker's Tips for Dealing with Bad Book Reviews. One of the commentators suggested that someone should do a post on “Tips for Writing Reviews Where the Books Weren’t Totally Awesome”. Challenge accepted.)
1. Objectivity: Say specifically what you saw on the page
I get no value from a review that says "this is a badly-written book" or "this is my favourite author" or "I loved this so much" or "I hated every page", any more than I get value from reviews that copy and paste the publisher's synopsis at the beginning. I want to know what I will see on the page that is, potentially, good or bad.
I was a book editor for a while (nearly 20 years ago now, but I still have the mindset), so I will often highlight the author's competence with punctuation, or use of words that don't mean what they think they mean. Some people don't care about this at all (since they don't know or follow the rules themselves). The fact that the author gets these things wrong won't interfere with their enjoyment of the book. But if you do care, it will interfere with that enjoyment, and I for one would appreciate knowing that about a book in advance.
It's also, unlike most other feedback, useful to the author, since it may help to motivate them to get a better editor next time (or get one at all).
I also talk about anachronisms in books with historical settings, for much the same reason.
2. Subjectivity: Acknowledge that tastes differ
Sometimes, what I hate about a book may be someone else's favourite thing. So I phrase my opinions as opinions. I talk about what the author did (objectivity) and how I feel about it (subjectivity).
For example, I recently reviewed a book that had no antagonist and very little of what could be traditionally called "conflict" or "action". People sat around and ate ice cream together a lot. Many, many readers would hate this, but (because of some other aspects of the book, which I also mentioned) I liked it.
There are also things that annoy me that don't annoy other people. I'm fussy about names, for example. I like the non-fantasy parts of fantasy worlds to work like the real world, so having a full moon and a new moon in the sky at the same time is a big black mark. If this kind of thing is what I didn't like about the book, again, I say so (rather than a vague "the worldbuilding is sloppy"), and usually mention that it may be a thing that only bothers me, so that if someone else doesn't care they can discount my rating.
3. It's not about the author
I try (again, I may not always succeed) to avoid making the review about the author's competence, let alone their personal qualities. "I don't see X on the page" is a much more emotionally neutral statement than "the author is no good at doing X" or "this is a lazy, bad author" (though I've been guilty of saying something not too different from that last one).
"I didn't enjoy it because Y" doesn't need to become "I hate this author and his little dog too".
4. Allow for the possibility of improvement
Just as I rarely give five stars, I rarely give one star. To me, five stars means "it would be difficult or impossible to improve this book", and I rarely think that. And one star, in my personal rating system, means "this is a complete waste of time with no redeeming qualities and I don't even see any potential in this author", and that's even more rare. I always try to talk about things that worked, and if I finished the book there must have been something that worked. (Sometimes I don't finish the book because, for me, not enough is working.)
I recently reviewed a second book in a series, and took pains to point out the ways in which it was an improvement over the first, even though I still felt it had significant flaws.
5. Say something fresh
Again, this is something I do that other people may not. Some reviewers read other reviews of the book before writing theirs, and enter into a kind of dialogue with them, disagreeing or agreeing. I don't do that, in part so that my review will be a fresh perspective specific to me.
If I'm writing for other readers, rather than just to relieve my feelings, that will best be served if I say something that other people aren't saying, with specific reference to what's on the page, acknowledging my personal taste and avoiding attacks on the author.
In my opinion.