I think comparing the entry id's is the best way to go for the current page. But for determining if a certain page is a parent of the current page, I combined answers from @tim-kelty and @carlcs to come up with this:
{% for entry in entries %}
{% set isInSection = craft.request.firstSegment == entry.uri|split('/')[0] %}
<a href="{{ entry.url }}" class="{{ isInSection ? 'active' : '' }}">{{ entry.title }}</a>
{% endfor %}
EDIT: I realized my above code does something slightly different than I originally thought: it will add the 'active' class to any items that are in the current' page's section... which includes siblings. If that's what you want, then it's great. But if you only want to indicate the actual top-level section parent page, then you should do this instead:
{% for entry in entries %}
{% set isTopParent = craft.request.firstSegment == entry.uri %}
<a href="{{ entry.url }}" class="{{ isTopParent ? 'active' : '' }}">{{ entry.title }}</a>
{% endfor %}
Last but not least, if you want to hilite all pages that are in the parent "path" of the current page (which is what I most often need in my menus), you can do this:
{# use different var name in the loop because we assume `entry` is already set to the currently-viewed page #}
{% for page in entries %}
{% set isInPath = entry.uri matches '{^' ~ page.uri ~ '}' %}
<a href="{{ page.url }}" class="{{ isInPath ? 'active' : '' }}">{{ page.title }}</a>
{% endfor %}
I've posted a full example that encompasses a lot of "denote the active page or its parents" logic here: http://craftcookbook.net/recipes/388