Since the span is next to the like, just has to use next(), see modification:
$(document).ready(function () {
$('a.like').click(function () {
var next = $(this).next()
var test = $(this).next().html();
if ($(this).attr('class') == 'like') {
$.post("like.cfm", {
postid: $(this).attr("postid"),
uid: $(this).attr("uid")
});
$(this).removeClass('like').addClass('unlike').html('Unlike');
test++;
} else {
$.post("unlike.cfm", {
pageID: $(this).attr("postid")
});
$(this).removeClass('unlike').addClass('like').html('Like');
test--;
}
next.html(test);
});
});