Ethics and acknowledgements
To avoid similar issues cropping up again, after the initial brainstorming phase, it's important to agree on a plan for who is doing what. If you agree on a direction you both think should be checked, then make sure you have the discussion about who is going to carry out the next step, and if it's not you, then make sure you identify something concrete that you can contribute later on. If the discussion is in person, then fire off a quick email afterwards to confirm what you understood from the meeting so that you both have it in writing. 

Can it be useful to you that you are acknowledged by a superstar colleague? I think so. I've seen many application forms that ask you to show that you are able to foster collaborations with colleagues outside of your research group. This is the kind of example that you could put as evidence that you are working with some great people.

In your current situation, I think you are probably right that there's not much you can change at this point, but there are perhaps a couple of things that you could try:


If you are able to see a possible extension or improvement to what your colleague has already done,  then suggest it, and jump in there straight away with "... I'll get straight on to looking at that" (i.e. don't give him an opportunity to just take your suggestion and use it himself). You might be able to push your way into being more integral to the paper.
You say he's a very very nice person, it might be worth talking honestly! Not an easy conversation to have, but you could try something like "Wow, that was quick work, I'd been wondering if we might have worked on it together! Is there anything further that I could contribute?" ... so long as you can make sure that it comes across as positive rather than bitter.