Gasoline trends continue to adversely affect convenience-store operator Casey's General Stores (NASDAQ:CASY), but the overall appeal of the name remains intact.

Casey's released second-quarter earnings last Thursday and reported that while total sales advanced 4.8%, earnings fell 22.7% as compared with last year's quarter. This was due primarily to gasoline gross profit margins that fell to $0.094 per gallon from an unsustainably high $0.141 that stemmed from "post-Katrina" benefits to gas sales and margins. The difference caused total gasoline profit margins to fall 26.8% for the quarter.

Gasoline sales are clearly important to Casey's, as they account for approximately 70% of total annual sales. Gross profit margins reached $0.115 per gallon for all of fiscal 2006 but ran below $0.11 the previous two years. In other words, don't expect the margin to return to $0.14 anytime soon; management's goal is $0.108 margins over time.

On a more positive note, total gallons sold grew 9.4% and same-store gasoline comps advanced 2.7% for the quarter, as lower prices helped overall demand. And gas is what brings customers to the stores to purchase high-margin grocery and prepared food and drink merchandise. For the quarter, grocery items had a 32.2% average margin, while the prepared items posted an impressive 62.2% average margin. Both categories also saw nice increases in total and comparable sales.

Casey's has a competitive advantage in that it targets smaller, rural towns with populations as low as 5,000 individuals. Management states that it can be profitable operating in a town with as few as 500 residents. This keeps it out of the path of retailing behemoths such as Wal-Mart (NYSE:WMT), grocery giant Kroger (NYSE:KR), and other national players including Walgreen (NYSE:WAG) and CVS (NYSE:CVS) that sell food and merchandise through convenient, free-standing locations.

Additionally, the company is small itself, at fewer than 1,500 stores, and operates in only nine Midwestern states. That means there's plenty of opportunity to expand domestically via new-store openings and acquisitions of mom-and-pop operators in the highly fragmented convenience-store industry. Archrival ThePantry (NASDAQ:PTRY) is another major player with a similar growth strategy.

Being a smaller operator, Casey's probably doesn't have a lot of clout in negotiating the best wholesale prices for its gasoline, but overall volatility in the commodity affects all involved in the industry. Investors are seeing this play out through Casey's bottom-line weakness so far this fiscal year, but the long-term picture still looks bright.

For related Foolishness:

Wal-Mart is an Inside Value recommendation. Take the newsletter for a 30-day free trial.

Fool contributor Ryan Fuhrmann has no financial interest in any company mentioned. The Fool has an ironclad disclosure policy. Feel free to email him with feedback or to discuss any companies mentioned.