Generally, one should not purchase a mutual fund a few days before the record date to avoid owing taxes on the entire distribution. Suppose we purchased $10,000 of Fidelity Select Electronics Fund at $37.65 per share the day before the record date. Since we owned 265.6 shares on the record date, we would receive a distribution of $1845.95. We neither gained nor lost money, but some of it has been converted into cash. Unfortunately, the distribution is taxed so we'd pay income taxes on the $1845.95. Thus, it's generally a good idea to purchase mutual funds after, not before, record dates.
Some mutual funds actively trade securities, generating a large amount of short-term capital gains. Owning these mutual funds means one must pay taxes, at one's ordinary income tax rate, every year. If you use your distributions to purchase more shares, you'll need to find other cash to pay your income taxes on the distributions.
Others trade very infrequently, generating very small amounts of distributions. Thus, your annual income taxes will be lower. The taxman still cometh, however. When selling these funds, one has to pay capital gains taxes. Since long-term capital gains are taxed at lower rates than short-term capital gains, you can still reduce your tax bill. Thus, mutual funds rated with the highest annual appreciation may not yield the largest after-tax appreciation.
All these taxing problems are avoided for mutual funds held in tax-deferred accounts, e.g., IRAs. For these, there's no need to pay income taxes and no need to worry about record dates.