Rechargeable Battery Overheating

I have a project that I'm working on that uses a relatively cheap battery pack as it's main power source. This pack consists of two sets of four AAA rechargeable batteries. I was trying to work out a way to charge them through a USB port, but I found that some USB ports put out more power than others, and I was exploring other options for power as well. When testing, I found that using anything more than 300mA on the pack caused it to get excessively hot, and I read that some USB can put out as much as 500mA, which would be a huge problem in my system. I was wondering how I would go about wiring to limit the amperage that the battery pack receives from the port? I assumed at first that I could just wire in a resistor and go about my merry way, but that seems wrong for some reason. Electrical is not my forte, yet, so I just want to make sure before I break something.

I assume these are NiMH cells. Not that simple to charge. Read up a little: NiMH battery technology, how to charge Nickel Metal Hydride Batteries tutorial for design engineers, as well as NiMH chargers.

They certainly are, and now I am even more convinced that I should be using lithium ion batteries. I considered just stealing a battery from a cell phone, but I didn't think it would be very easy to hook up, charge, or maintain. Is there an easy way to do this with a battery like the ones in most cell phones?

Li-ion are easier to charge, but if you are not that familiar with electronics, I would suggest buying a charger for them. Chargers are very cheap on ebay. Li-ion cells and batteries are available on ebay also. HobbyKing is a good source for both lithium batteries and chargers.

And since you already have the NiMH, why not just buy a charger for them? You can probably get one locally for a few bucks.

I'm trying to make the build so that I can charge the batteries with the entire unit inside an enclosure. I want to have a single power plug on the outside, that charges the batteries, and the batteries inside the enclosure, powering the Arduino board. The batteries powering the board part works like a charm, it's the charging that I am concerned about. When I tried using a 300mA charger, the battery pack got incredibly hot, so I was just looking for a way to decrease the amperage to about 100 mA.

Heres a crude method of achieving what you want.
Connect a 5.6V 3 watt or bigger Zener diode, across the battery terminals, so that the Zener starts to conduct
when the battery voltage get to 5.6 V.
NimH cells can be charged to 1.4 V per cell without them overheating. and 1.4 V is a fair approximation of the battery
fully charged.
4 cells in series = 1.4 X 4 = 5.6 V.
The Zener diode will get warm so you will nead a heatsink of some kind.